|
| 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) |
0 commit comments