Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
GitHub Pages-compatible Jekyll theme for a book with chapters and parts in a style reminiscent of GitBook.
Jekyll Chapterbook is an open-source Jekyll theme that converts a folder of Markdown chapter files into a GitBook-style book with automatically numbered parts and chapters, and it is built to run natively on GitHub Pages without any plugins.
Jekyll Chapterbook is a Jekyll theme created by Jason Grimes, originally based on Tao He's jekyll-gitbook theme. It takes Jekyll pages written in Markdown, stored in a _chapters directory, and generates a static HTML book with front matter, parts, chapters, and automatic numbering. The output is a flat folder of portable HTML files in _site that can be hosted anywhere or browsed offline. It runs on Jekyll and works with GitHub Pages out of the box because it doesn't depend on custom plugins.
The theme's key differentiator is its plugin-free design, which keeps GitHub Pages compatibility while adding book-specific structures. Here are its main features:
010-intro.md and 020-thesis.md appear in order on the filesystem and in the book; inserting a new chapter is as simple as naming it 035-synthesis.md.000-front/ and 999-back/ directories place unnumbered pages like a preface or references before and after the numbered content..draft to a chapter's numeric prefix hides it from the table of contents and numbering but lists it in a separate outline, letting you write a book from an outline of empty chapters.github_edit in _config.yml, supporting quick edits even from mobile._site with no subfolders, so links stay stable during reorganization and the book can be browsed offline from a local file system.chapter-link.html, chapterbook-toc.html, figure.html, and chapter-vars.html provide cross-linking, tables of contents, figures, and theme variables without plugins.The documentation describes a clear setup: install the theme by forking the repo or using remote_theme: jasongrimes/jekyll-chapterbook in _config.yml, then add Markdown files to _chapters. Chapters use front matter with title, slug, and optional abstract. The theme orders chapters by the numeric prefix, renders the table of contents in the sidebar, and outputs flat HTML to _site.
The theme is open source and free to use, released under the Apache License, Version 2.0. Both the theme and its predecessor jekyll-gitbook are Apache-2.0 licensed.
No. The theme is designed to work without custom plugins, so it runs natively on GitHub Pages using the remote theme mechanism. It uses Liquid templates and standard Jekyll includes to implement features like chapter links and tables of contents.
Yes. Because it has no plugin dependencies, you can use it on GitHub Pages by setting remote_theme: jasongrimes/jekyll-chapterbook in your _config.yml. You can also fork the repository and add your own chapters.
Rename the file to add .draft to the numeric prefix, for example 010.draft-introduction.md. Drafts are excluded from the table of contents and numbering but appear in the outline view, and you can enable show_drafts_in_dev to preview how they would be numbered.
Create numbered subdirectories inside _chapters, for example 010-thesis/ and 020-antithesis/, and move chapter files into them. The directory name without the numeric prefix is shown as the part name, and part directory names determine order.
Yes. The theme provides a chapter-link.html helper that renders a link to the chapter with a given slug, using its current title and chapter number. Because it uses the slug, links remain valid as long as the slug stays the same.
