─── ❖ ── ✦ ── ❖ ───

Associated notes

This note is part of a series about how this blog is set up. See here for an overview.

This note is about how to spin up your own quartz instance, hosted on GitHub Pages. It’s a minimal setup that will look like the Quartz documentation) and it’s the starting point for additional customizations.

In this guide we’ll host Quartz on GitHub Pages, however there are other options. This basic setup requires no locally installed software, you can work entirely on the GitHub website.

  • Fork https://github.com/jackyzha0/quartz into your GitHub account.
    • Your blog can be reachable at GHUSERNAME.github.io (fork as GHUSERNAME.github.io) or a subdomain, like GHUSERNAME.github.io/blog (fork as blog). You only need to fork the branch v4.
  • (optional) Create new branch β€œupstream”
    • From branch v4, useful to compare changes that happen upstream, see this note for more details.
  • (optional) Delete the files README.md and .github/workflows/ci.yaml
  • Create a new file content/index.md.
    • The file can be empty (for now), look here for inspirations.
  • Follow the Minimal required config changes:
    • See the start of quartz.config.ts below for the two lines that need to be changed (might change with newer Quartz versions).
  • Create a new file .github/workflows/deploy.yml, for the contents see https://quartz.jzhao.xyz/hosting#github-pages
  • Head to β€œSettings” tab of your forked repository and in the sidebar, click β€œPages”. Under β€œSource”, select β€œGitHub Actions”.
  • (optional) Follow the instructions for use with a custom domain if you don’t want your URL to contain github.io
quartz.config.ts
import { QuartzConfig } from "./quartz/cfg"
import * as Plugin from "./quartz/plugins"
 
/**
 * Quartz 4.0 Configuration
 *
 * See https://quartz.jzhao.xyz/configuration for more information.
 */
const config: QuartzConfig = {
  configuration: {
    pageTitle: "πŸͺ΄ Quartz 4.0",
    enableSPA: true,
    enablePopovers: true,
    analytics: {
      provider: "plausible",
    },
    locale: "en-US",
    baseUrl: "quartz.jzhao.xyz",
    ignorePatterns: ["private", "templates", ".obsidian"],
    defaultDateType: "created",

New blog posts can be created by creating new files in the folder content (or in a subdirectory of this folder).


delete the folder β€œcontent” and the file README.md (and Build and Test workflow)

─── ❖ ── ✦ ── ❖ ───