This repository is a gatsby theme development project. The theme (not the example folder) can be used/installed as a gatsby plugin in an other gatsby project.
To use this theme in a project, read the docs at ./gatsby-theme-w3f/readme.md
; this project is available as @w3f/gatsby-theme-w3f package on npm repository.
Gatsby theme take advantage of yarn
and its workspace
feature, to
offer ease of development.
To develop locally on the theme, run the following commands from the root of this repository:
git clone <this-repo-git-url>
cd <the-repo-we-just-cloned>
yarn workspace example install
yarn workspace example develop
When the example is running, it will use the theme folder (inside this repository), as a gatsby module
If you want to use netlify-cms against the local repository (instead
of the one on the remote), in ./example/.env.development
, add the
line GATSBY_NETLIFY_CMS_GIT_LOCAL=true
.
Then in a new shell (aside the local development environment for this project), run the commands:
cd example
npx netlify-cms-proxy-server
To debug yarn workspaces on which this theme development is based, you
can use the command yarn workspaces info
in the project's root
folder (see
docs).
This repository, has two projects in two folders, the theme, and a theme example.
This directory is the theme package itself, with all code and default configuration.
gatsby-theme-w3f/
gatsby-config.js
: gatsby-config, starting point of theme functionalitiesindex.js
: Since themes also function as plugins, this is an empty file that gatsby needs to use this theme as a plugin.package.json
: theme dependencies.gatsby
should be apeerDependency
.
To develop on the theme, you have to develop through the
example
workspace/project.
This is an example usage of the theme, also used to develop on the theme.
example/
gatsby-config.js
: Specifies the theme that is used, the plugins, and their configurationsrc/
: Source code such as one-off pages or components that might live in a user's site.
You can run the example project with:
yarn workspace example develop
This project's package.json
version, is not used for anything, nor is the one from the example project.
Only the one from the theme folder is important for releasing new versions to npm.