Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Generate GitBook style modern docs/tutorial websites using Gatsby + MDX
Gatsby Gitbook Starter is a Gatsby + MDX boilerplate for building GitBook-style documentation and tutorial websites, created by Hasura to power the GraphQL tutorial series at learn.hasura.io. It turns Markdown and MDX files into a static site with a sidebar, search, dark mode, and offline support.
Gatsby Gitbook Starter is a starter template built on Gatsby, a React-based static site generator, that compiles Markdown and MDX files from a content folder into a documentation website. It produces a static site that can be deployed as Docker containers or to platforms like Netlify and Now.sh, and it is maintained by Hasura. The template includes a GitBook-inspired theme, automatic sidebar navigation, and built-in SEO features.
react-live=true to any code block to render an editable React component.Documentation teams and open-source projects that want a fast, static docs site without building from scratch can use this starter. Tutorial creators who write multi-part content in Markdown and want a consistent theme with search and navigation benefit from the automatic sidebar and previous/next links. Developers already familiar with Gatsby or React can quickly customize the theme and layout to match their brand.
After cloning the repository and running npm install and npm start, a development server runs at localhost:8000. Content lives in the content folder as Markdown files; config.js controls global settings for the header, sidebar, site metadata, search, and PWA. The build command (npm run build) produces a static site and, if enabled, indexes content into Algolia. Deployment targets include Netlify, Now.sh, and Docker containers.
To enable search, open config.js and set the search.enabled flag to true, then provide your Algolia index name, app ID, search key, and admin key (the keys can be stored as environment variables). Run npm run build to generate the index, and search will work on the deployed site.
Yes, when the pwa.enabled option is set to true in config.js, a service worker is registered and the site gains offline functionality. Disabling this option removes the existing service worker.
Yes. Add the string react-live=true to any code block's language tag (for example, three backticks followed by javascript react-live=true) to render an editable React component that readers can modify in the browser.
Set the forcedNavOrder array in the sidebar section of config.js to specify the order of top-level pages, using paths like "/filename". To create sub-navigation, place a folder with the same name as a top-level Markdown file; its contents will appear nested and sorted alphabetically. The ignoreIndex flag hides the index.md from the sidebar.
Yes, this is an open-source starter template. You can clone the repository from GitHub and use it for any project, including commercial documentation sites.
