The final chapter covers getting your book out into the world — as a printed/PDF document and as a deployed website.
Printing to PDF
Folio is print-ready out of the box. To export a chapter (or the whole book), just use your browser’s Print → Save as PDF. The result automatically:
- leaves out the navigation, buttons, footer, and theme toggle, so the PDF contains only your content;
- centers images and keeps them from overflowing the page;
- uses a comfortable, readable text size for print.
You can fine-tune the output with the utility classes from the writing chapter:
.page-break forces a new page before an element, and .hidden-print hides
anything you don’t want in the export.
Building the site
To produce the static site without running a server:
bundle exec jekyll build
The compiled HTML, CSS, and JS are written to _site/. That folder is fully
self-contained and can be uploaded to any static host. (You normally don’t commit
_site/ — let your host build it, or deploy the folder as an artifact.)
GitHub Pages
The simplest deployment path:
- Push the repository to GitHub.
- Open Settings → Pages.
- Under Build and deployment, choose to build from a branch, then select the
mainbranch and the/(root) folder. - GitHub runs Jekyll for you and publishes the result.
If you prefer to control the Jekyll version or add plugins, use a GitHub Actions workflow (the official
actions/jekyll-build-pagesaction) instead of the built-in branch build. This guarantees the same Jekyll~> 4.4you use locally.
The baseurl and local development
A project site lives under a subpath (for example
https://you.github.io/folio/), so the built site needs baseurl set to that
subpath. But hard-coding baseurl: "/folio" in _config.yml forces you to
browse http://localhost:4000/folio/ during development, which is easy to
forget.
The cleaner approach is to leave baseurl empty in _config.yml (so local
development works at the root) and let the deployment set it at build time. The
actions/configure-pages step exposes the correct path, which the build picks
up:
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
run: bundle exec jekyll build --baseurl "$"
This way bundle exec jekyll serve works at http://localhost:4000 locally,
while the deployed site still resolves all links under the project subpath.
Because Folio’s templates build URLs with the relative_url filter, both
environments work without any further changes.
Other static hosts
Because jekyll build emits a plain _site/ folder, Folio works on any static
host — Netlify, Cloudflare Pages, Vercel, GitLab Pages, S3, or your own server.
Set the build command to bundle exec jekyll build and the publish directory to
_site.
Custom domains
When serving from a custom domain:
- Configure the domain with your host (for GitHub Pages, Settings → Pages →
Custom domain, which writes a
CNAMEfile). -
Update
urlin_config.ymlto the canonical address:url: "https://books.example.com"
Keeping url accurate ensures absolute links and the share feature point at the
right place.