Skip to content

Commit 3852474

Browse files
committed
Initial commit
0 parents  commit 3852474

File tree

101 files changed

+21928
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+21928
-0
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.cache
2+
public
3+
.log
4+
node_modules

LICENSE

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
The BSD Zero Clause License (0BSD)
2+
3+
Copyright (c) 2020 Gatsby Inc.
4+
5+
Permission to use, copy, modify, and/or distribute this software for any
6+
purpose with or without fee is hereby granted.
7+
8+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14+
PERFORMANCE OF THIS SOFTWARE.

README.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<p align="center">
2+
<a href="https://www.gatsbyjs.com">
3+
<img alt="Gatsby" src="https://www.gatsbyjs.com/Gatsby-Monogram.svg" width="60" />
4+
</a>
5+
</p>
6+
<h1 align="center">
7+
Starter for creating a Gatsby Theme workspace
8+
</h1>
9+
10+
```shell
11+
gatsby new my-theme https://github.com/gatsbyjs/gatsby-starter-theme-workspace
12+
cd my-theme
13+
yarn workspace example develop
14+
```
15+
16+
## Layout
17+
18+
```text
19+
.
20+
├── README.md
21+
├── gatsby-theme-minimal
22+
│   ├── README.md
23+
│   ├── gatsby-config.js
24+
│   ├── index.js
25+
│   └── package.json
26+
├── example
27+
│   ├── README.md
28+
│   ├── gatsby-config.js
29+
│   ├── package.json
30+
│   └── src
31+
├── package.json
32+
└── yarn.lock
33+
34+
3 directories, 10 files
35+
```
36+
37+
### `gatsby-theme-minimal`
38+
39+
This directory is the theme package itself. You should rename this at
40+
some point to be `gatsby-theme-{my-theme-name}`. Also change the
41+
`package.json` name field and the corresponding dependency in the
42+
example directory's `package.json`/`gatsby-config.js` to match the chosen name.
43+
44+
- `gatsby-theme-minimal/`
45+
- `gatsby-config.js`: An empty gatsby-config that you can use as a starting point for building functionality into your theme.
46+
- `index.js`: Since themes also function as plugins, this is an empty file that
47+
gatsby needs to use this theme as a plugin.
48+
- `package.json`: The dependencies that your theme will pull in when people install it. `gatsby` should be a `peerDependency`.
49+
50+
### `example`
51+
52+
This is an example usage of your theme. It should look the same as the
53+
site of someone who installed and used your theme from npm.
54+
55+
- `example/`
56+
- `gatsby-config.js`: Specifies which theme to use and any other one-off config a site might need.
57+
- `src/`: Source code such as one-off pages or components that might live in
58+
a user's site.
59+
60+
You can run the example with:
61+
62+
```shell
63+
yarn workspace example develop
64+
```
65+
66+
## 🚀 Quick start (Gatsby Cloud)
67+
68+
Deploy this starter with one click on [Gatsby Cloud](https://www.gatsbyjs.com/cloud/):
69+
70+
[<img src="https://www.gatsbyjs.com/deploynow.svg" alt="Deploy to Gatsby Cloud">](https://www.gatsbyjs.com/dashboard/deploynow?url=https://github.com/gatsbyjs/gatsby-starter-theme-workspace)

package.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "gatsby-theme-iterative-docs-workspace",
3+
"private": true,
4+
"version": "0.0.1",
5+
"main": "index.js",
6+
"license": "MIT",
7+
"scripts": {
8+
"build": "yarn workspace example build",
9+
"develop": "yarn workspace example develop"
10+
},
11+
"workspaces": ["./packages/*"]
12+
}

packages/example/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Gatsby Theme Minimal Example
2+
3+
A usage of
4+
[gatsby-theme-minimal](https://github.com/ChristopherBiscardi/gatsby-theme-minimal)
5+
that does nothing but use the theme. As a result you will see `Error: Missing resources for /` when navigating to `http://localhost:8000`. To get
6+
rid of that, create a page in `src/pages/index.js`.
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Example Docs Index!
2+
3+
This is the example homepage of this example docs site!

packages/example/content/docs/page.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# This is a docs page
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
name: Term
3+
match: [term, terms]
4+
tooltip: >-
5+
This is something in the *glossary*!
6+
---

packages/example/gatsby-config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
siteMetadata: {
3+
title: "Example website",
4+
description: "Example website description",
5+
keywords: ["docs", "test"],
6+
siteUrl: "localhost:8000",
7+
},
8+
plugins: [{ resolve: `gatsby-theme-iterative-docs`, options: {} }],
9+
};

packages/example/package.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "example",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"author": "christopherbiscardi <[email protected]> (@chrisbiscardi)",
6+
"license": "MIT",
7+
"scripts": {
8+
"develop": "gatsby develop",
9+
"build": "gatsby build"
10+
},
11+
"dependencies": {
12+
"gatsby": "^4.7.1",
13+
"gatsby-theme-iterative-docs": "^0.0.1",
14+
"gatsby-transformer-remark": "^5.7.0",
15+
"react": "^17.0.2",
16+
"react-dom": "^17.0.2"
17+
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = [];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = [
2+
{
3+
slug: "",
4+
label: "Home",
5+
source: "index.md",
6+
icon: "house",
7+
},
8+
"page",
9+
];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import React from "react";
2+
import { graphql } from "gatsby";
3+
import { Node } from "unist";
4+
import { getItemByPath } from "gatsby-theme-iterative-docs/src/utils/shared/sidebar";
5+
6+
import SEO from "gatsby-theme-iterative-docs/src/components/SEO";
7+
8+
import DocumentationLayout from "gatsby-theme-iterative-docs/src/components/Documentation/Layout";
9+
import Documentation from "gatsby-theme-iterative-docs/src/components/Documentation";
10+
11+
interface IDocPageProps {
12+
data: {
13+
page: {
14+
description?: string;
15+
title?: string;
16+
parent: {
17+
htmlAst: Node;
18+
};
19+
};
20+
};
21+
pageContext: {
22+
slug: string;
23+
headings: [];
24+
};
25+
}
26+
27+
const DocPage: React.FC<IDocPageProps> = ({
28+
data,
29+
pageContext: { slug, headings },
30+
}) => {
31+
const {
32+
page: {
33+
description,
34+
title,
35+
parent: { htmlAst },
36+
},
37+
} = data;
38+
39+
const { label } = getItemByPath(slug);
40+
41+
return (
42+
<>
43+
<SEO title={title || label} description={description} />
44+
<DocumentationLayout currentPath={slug}>
45+
<Documentation htmlAst={htmlAst} path={slug} headings={headings} />
46+
</DocumentationLayout>
47+
</>
48+
);
49+
};
50+
51+
export default DocPage;
52+
53+
export const pageQuery = graphql`
54+
query OurDocPage($id: String!) {
55+
page: docsPage(id: { eq: $id }) {
56+
description
57+
title
58+
parent {
59+
... on MarkdownRemark {
60+
htmlAst
61+
}
62+
}
63+
}
64+
}
65+
`;

packages/example/src/pages/index.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from "react";
2+
import { Link } from "gatsby";
3+
4+
export default function Home() {
5+
return (
6+
<div>
7+
See the docs <Link to="/doc">here!</Link>
8+
</div>
9+
);
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const screens = {
2+
giant: 1200,
3+
desktop: 1005,
4+
tablet: 768,
5+
phablet: 572,
6+
phone: 376
7+
}
8+
9+
module.exports = {
10+
screens,
11+
customMedia: {
12+
'--xxs-scr': `(max-width: ${screens.phone}px)`,
13+
'--xs-scr': `(max-width: ${screens.phablet}px)`,
14+
'--sm-scr': `(max-width: ${screens.tablet}px)`,
15+
'--md-scr': `(max-width: ${screens.desktop - 1}px)`,
16+
'--lg-scr': `(min-width: ${screens.desktop}px)`,
17+
'--xl-scr': `(min-width: ${screens.giant}px)`
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
const { customMedia } = require('./media')
2+
3+
const focus = {
4+
'&:focus': {
5+
color: 'var(--color-orange)'
6+
}
7+
}
8+
9+
const active = {
10+
'&:active': {
11+
position: 'relative',
12+
top: '1px',
13+
left: '1px'
14+
}
15+
}
16+
17+
const hover = {
18+
'&:hover': {
19+
opacity: 0.7
20+
}
21+
}
22+
23+
module.exports = {
24+
mixins: {
25+
'h1-desktop': {
26+
'font-weight': '500',
27+
'font-size': '40px',
28+
'line-height': '60px'
29+
},
30+
'h1-mobile': {
31+
'font-weight': '500',
32+
'font-size': '30px',
33+
'line-height': '40px'
34+
},
35+
'h2-desktop': {
36+
'font-weight': '500',
37+
'font-size': '30px',
38+
'line-height': '40px'
39+
},
40+
'h2-mobile': {
41+
'font-weight': '500',
42+
'font-size': '25px',
43+
'line-height': '35px'
44+
},
45+
'h3-desktop': {
46+
'font-weight': '500',
47+
'font-size': '24px',
48+
'line-height': '34px'
49+
},
50+
'h3-mobile': {
51+
'font-weight': '500',
52+
'font-size': '20px',
53+
'line-height': '30px'
54+
},
55+
'text-desktop': {
56+
'font-size': '24px',
57+
'line-height': '34px'
58+
},
59+
'text-mobile': {
60+
'font-size': '20px',
61+
'line-height': '30px'
62+
},
63+
'text-diminished': {
64+
'font-size': '20px',
65+
'line-height': '30px'
66+
},
67+
'text-secondary': {
68+
'font-size': '16px',
69+
'line-height': '24px'
70+
},
71+
'button-big': {
72+
'font-size': '20px',
73+
'line-height': '30px'
74+
},
75+
'button-small': {
76+
'font-size': '16px',
77+
'line-height': '25px'
78+
},
79+
columns: {
80+
display: 'flex',
81+
'flex-direction': 'row',
82+
'flex-flow': 'wrap',
83+
'justify-content': 'space-between',
84+
85+
[`@media ${customMedia['--sm-scr']}`]: {
86+
'flex-direction': 'row'
87+
},
88+
89+
[`@media ${customMedia['--xs-scr']}`]: {
90+
'justify-content': 'center'
91+
}
92+
},
93+
column: {
94+
'flex-basis': '33.3%',
95+
96+
[`@media ${customMedia['--sm-scr']}`]: {
97+
'flex-basis': '50%'
98+
},
99+
100+
[`@media ${customMedia['--xs-scr']}`]: {
101+
'flex-basis': '100%'
102+
}
103+
},
104+
link: {
105+
'text-decoration': 'none',
106+
color: 'var(--color-blue)',
107+
...hover,
108+
...focus,
109+
...active
110+
},
111+
hover,
112+
focus,
113+
active
114+
}
115+
}

0 commit comments

Comments
 (0)