🎁

12 Days of Baddass Courses sale! Get instant access to the entire egghead library of courses and lessons for 58% off.

Runs out in:
15 : 06 : 03 : 37
1×
Become a member
to unlock all features
Autoplay

    Add documentation to a Gatsby site with the Docz Gatsby theme

    Kyle GillKyle Gill
    gatsbyGatsby

    In this lesson, learn how to quickly add documentation pages to a Gatsby site with Docz's Gatsby theme.

    Related Links

    Code

    Code

    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    Discuss

    Discuss

    Transcript

    Transcript

    Instructor: Inside of the Gatsby project, I'm using the default Gatsby starter. Run npm install --save gatsby-theme-docz@next to install the latest version of the docz theme. To verify it installed in your package.json, you should see a version that is at 2.0or higher. Then you can add the theme to your plugins array inside of your Gatsby config file.

    With the theme added, you can add MDX files that will automatically be turned into docs pages. Add a file alongside the image component called image.mdx with the frontmatter name image and route image. The name will appear in the sidebar. The route is where the page will be set up. You can then add markdown and import components to use inside the page.

    Start your server with gatsby develop and navigate to the image route. You should see a doc page with the image component.