Gatsby theme for MDX-powered docs using the Carbon Design System
- Download the starter with theme
npx gatsby new my-carbon-docs https://github.com/ryanomackey/gatsby-carbon-docs-starter
cd my-carbon-docs
- Start the development server:
# With NPM:
npm run develop
# With Yarn:
yarn develop
If all went well, you should be able to head over to http://localhost:8000
to see your new docs!
If all didn't go so well, or you're just curious about Gatsby itself, head over to their documentation for more information.
At the root of your project should be a directory called data
with a file called sections.yaml
.
This file lets the theme know what you want the top-level sections of your left nav to be.
For example, if we wanted to add a new section, we could do so by simply adding a new entry like so:
-
location: books
title: Books
-
location: movies
title: Movies
-
location: music
title: Music
To add a page, simply add a new mdx file to the docs/
directory:
touch docs/music/the-beatles.mdx
Now, in the-beatles.mdx
we just add one piece of metadata (our title) and any other markdown/jsx content we want:
---
title: The Beatles
---
The Beatles were an English rock band formed in Liverpool in 1960...
Now, if you head over to http://localhost:8000/music/the-beatles
, you should see your brand new page.