Skip to content

Latest commit

 

History

History
29 lines (27 loc) · 1.5 KB

tutorial.md

File metadata and controls

29 lines (27 loc) · 1.5 KB

Tutorial

Building a documentation site from the Gatsby Documentation Starter

  1. Install gatsby npm install -g gatsby
  2. Install documentation site starter gatsby new docs-site gh:gatsbyjs/gatsby-starter-documentation
  3. type cd docs-site
  4. type gatsby develop
  5. Open site in browser at localhost:8000. Verify clicking on links works.
  6. Try editing the site's config file config.toml. Change the siteTitle key. The site's title should change shortly after saving.
  7. 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.
  8. Add a new markdown page to the documentation. Copy the getting-started directory to some-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, restart gatsby develop and then refresh your browser.
  9. Build your site gatsby build. The site is built to the /public directory. Test that the build worked by running gatsby serve-build which serves the contents of the /public directory.