Publishing

This repository publishes the Obsidian vault with Quartz, builds in GitHub Actions, and deploys the generated static site to Cloudflare Pages.

The workflow is .github/workflows/deploy-quartz.yml.

GitHub settings

Create these repository secrets:

  • CLOUDFLARE_ACCOUNT_ID: your Cloudflare account ID.
  • CLOUDFLARE_API_TOKEN: a Cloudflare API token with Account > Cloudflare Pages > Edit.

Create these repository variables:

  • CLOUDFLARE_PAGES_PROJECT: the Cloudflare Pages project name. Defaults to notes.
  • QUARTZ_BASE_URL: the public hostname without https://, for example notes.example.com. Defaults to notes-eze.pages.dev.

Cloudflare Pages

Create a Cloudflare Pages project named to match CLOUDFLARE_PAGES_PROJECT. The GitHub Action uses Cloudflare Pages Direct Upload, so Cloudflare does not need to run its own build command.

If you use a custom domain, add it to the Pages project and set QUARTZ_BASE_URL to that hostname.

Cloudflare Access

To password protect the site:

  1. In Cloudflare, go to Zero Trust > Access controls > Applications.
  2. Create a new application.
  3. Choose Self-hosted and private.
  4. Add the public hostname for the Pages site, for example notes-eze.pages.dev or notes.example.com.
  5. Add an Allow policy for the emails, email domain, GitHub organization, or identity provider group that should have access.
  6. Set the session duration you want.

Also protect or redirect the default Pages host:

  • In the Pages project, enable an Access policy for preview deployments.
  • Protect the production <project>.pages.dev hostname with Access, or redirect it to the protected custom domain using Cloudflare Bulk Redirects.

Cloudflare Access is enforced at the Cloudflare edge. Using Cloudflare Pages avoids the github.io bypass that would exist if the protected custom domain pointed at a public GitHub Pages origin, but the default pages.dev hostname still needs to be handled.

Quartz features

Search and graph are enabled by the Quartz layout and ContentIndex emitter:

  • Search appears in the left sidebar.
  • Local graph appears on note pages.
  • The graph component can be toggled to the global graph from the graph control.

Notes with draft: true in frontmatter are excluded by Quartz. The build also excludes Obsidian settings and local agent folders.