Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A Gatsby + Markdown documentation template that builds a navigable site with GitHub Pages deployment and hidden content support.
Document Template is an open-source Gatsby boilerplate that turns a folder of Markdown files into a navigable documentation website and deploys it to GitHub Pages.
Document Template is a starter repository from Centria (contact: [email protected]) built with Gatsby, React, Markdown, and GitHub Pages. It takes a content folder of Markdown files as input and produces a static documentation site with a collapsible side navbar generated from the folder structure. The template supports two content types: standard pages that inherit a shared layout from a template file, and custom pages such as the 404 page that developers define directly in the pages folder.
src/content; the folder hierarchy becomes the side navigation, and each folder's index Markdown file acts as its landing page.TEMPLATE_API secret; you only need to set the pathPrefix in gatsby-config.js to your repository name.title and nav_order front matter to control the display name and navbar sorting; avoid duplicate nav_order values because ordering is flat rather than hierarchical.src/content/hidden-docs and set hidden: true in their front matter to keep them out of the navbar but still linkable via a dedicated Link component.src/gatsby-plugin-theme-ui/components.js.src/styles/global.js reference Benjamin De Cock's reset, responsive breakpoints in src/styles/media.js follow Gatsby Theme Novela, and theme-ui colors can be adjusted in src/gatsby-plugin-theme-ui/color.js.npx update-template https://github.com/centria/template.hidden-docs feature.nav_order numbering, and link hidden exercise files to students without exposing solutions.Clone the repository with git clone https://github.com/centria/template, run npm install, then start a local server with npm start. Replace the src/content folder with your own Markdown files, set the required title and nav_order front matter, add a TEMPLATE_API secret and pathPrefix for GitHub Pages, and build the production bundle with npm run build. The template also supports linter checks via npm run lint.
Yes. The template is distributed under the MIT License, so it is free to use, modify, and distribute for personal and commercial projects.
Place the Markdown file in the src/content/hidden-docs folder and add hidden: true to its front matter. The page will not appear in navigation but can still be linked using the Link component.
Yes. Edit src/gatsby-plugin-theme-ui/components.js to extend Prism support for additional languages, and choose a different highlight style from the theme-ui Prism list (the default is oceanic).
Generate a GitHub personal access token with repo scope, add it as a TEMPLATE_API secret in your repository settings, set pathPrefix to your repository name, and push to the main branch. The included workflow handles the build and deployment.
The sidebar ordering is determined by the numeric nav_order field; duplicate values can cause unpredictable sorting. The README recommends giving each part at least two digits (e.g., 10, 11, 12) so later additions fit without re-numbering everything.
