- Install gatsby
npm install -g gatsby
- Install documentation site starter
gatsby new docs-site gh:gatsbyjs/gatsby-starter-documentation
- type
cd docs-site
- type
gatsby develop
- Open site in browser at localhost:8000. Verify clicking on links works.
- Try editing the site's config file
config.toml
. Change thesiteTitle
key. The site's title should change shortly after saving. - Next try editing a doc page. Open
/pages/docs/getting-started/index.md
and edit it. Again any saved changes should load without refreshing in the browser. - Add a new markdown page to the documentation. Copy the
getting-started
directory tosome-additional-steps
. Then edit the markdown file within the new directory. If you're familiar with other static site generation software, you'll be familiar with the "frontmatter" at the top of the file. Edit the title there + change the order to "5". Save this. Ideally this new file would be hot reloaded like other changes but I haven't figured out how to make this happen yet (help appreciated here). So to see your new page, restartgatsby develop
and then refresh your browser. - Build your site
gatsby build
. The site is built to the/public
directory. Test that the build worked by runninggatsby serve-build
which serves the contents of the/public
directory.