Digital Garden — Session Context

User Preferences

  • Caveman language (short, direct) but flexible enough to read
  • No unnecessary long outputs unless asked
  • Plain-text principle: vault stays 100% pure markdown

Project: Digital Garden

Stack: Obsidian (local) → GitHub private repo → Quartz v5 → Cloudflare Pages

Data flow:


Local PC → Obsidian Git plugin → GitHub (private) → CF Pages webhook → build → CF Edge

Single repo approach:

  • obsidian-vault — private, only .md files + quartz.config.yaml + build.sh
  • Quartz cloned fresh during each CF Pages build via build.sh

Vault Repo Structure


obsidian-vault/
 ├── index.md ← required root page (without this, site shows blank)
 ├── 404.md ← custom 404 page 
 ├── Folder/ 
 │ └── Hello.md 
 ├── README.md 
 ├── build.sh ← CF Pages build script 
 ├── localbuild.sh ← local dev script 
 └── quartz.config.yaml

Cloudflare Pages Build Config

| Field | Value | |---|---| | Build command | bash build.sh | | Deploy command | echo "done" (required field, not functional) | | Output dir | public | | Root directory | / |

build.sh (CF Pages):

#!/bin/bash
 
BUILD_DIR="/tmp/quartz-garden"
 
git clone https://github.com/jackyzha0/quartz "$BUILD_DIR"
 
cp quartz.config.yaml "$BUILD_DIR/"
cp -r . "$BUILD_DIR/content"
 
cd "$BUILD_DIR"
npm i
npx quartz plugin install
npx quartz build
 
cp -r public $OLDPWD/public

Local Dev Scripts

localbuild.sh — full build + serve (run once or when Quartz itself changes):

#!/bin/bash
 
QUARTZ_SRC_REPO_CACHE="/tmp/quartz-src-repo-cache"
QUARTZ_BUILD_CACHE="/tmp/quartz-build-cache"
BUILD_DIR="/tmp/quartz-garden"
 
if [ "$1" = "--full" ]; then
    if [ ! -d "$QUARTZ_SRC_REPO_CACHE" ]; then
        echo "Cloning Quartz..."
        git clone https://github.com/jackyzha0/quartz "$QUARTZ_SRC_REPO_CACHE"
    else
        git -C "$QUARTZ_SRC_REPO_CACHE" pull
    fi
 
    rm -rf "$BUILD_DIR"
    cp -r "$QUARTZ_SRC_REPO_CACHE" "$BUILD_DIR"
    cp quartz.config.yaml "$BUILD_DIR/"
    cp -r . "$BUILD_DIR/content"
 
    cd "$BUILD_DIR"
    npm i
    npx quartz plugin install
 
    if [ -d "$QUARTZ_BUILD_CACHE" ]; then
        echo "Restoring build cache..."
        cp -r "$QUARTZ_BUILD_CACHE" quartz/.quartz-cache
    fi
else
    rm -rf "$BUILD_DIR/content"
    cp -r . "$BUILD_DIR/content"
    cp quartz.config.yaml "$BUILD_DIR/"
    cd "$BUILD_DIR"
fi
 
npx quartz build --serve
# Note: build cache not saved on --serve (blocks). Only saved on --full without serve.

Run bash localbuild.sh --full first time. Then bare bash localbuild.sh for fast content-only refresh.


Draft System

Everything publishes by default. To hide a note:

---
draft: true
---

Obsidian Templater toggle script — assign hotkey (e.g. Ctrl+Shift+D):

<%*
const file = tp.file.find_tfile(tp.file.path(true));
const cache = app.metadataCache.getFileCache(file);
const fm = cache?.frontmatter;
const isDraft = fm?.draft === true;
 
await app.fileManager.processFrontMatter(file, (fm) => {
  if (isDraft) {
    delete fm.draft;
  } else {
    fm.draft = true;
  }
});
%>

quartz.config.yaml — Current State

  • pageTitle: "Krischal's Digital Garden"
  • pageTitleSuffix: " 🌱"
  • baseUrl: "digitalgarden.krischal.com.np"
  • analytics: null
  • enableSPA: true, enablePopovers: true
  • locale: "en-US"
  • Colors: lightMode / darkMode keys (not light / dark)
  • ignorePatterns: private, **.excalidraw, templates/**, .obsidian

Active plugins (all github:quartz-community/*):

  • Transformers: created-modified-date, obsidian-flavored-markdown, syntax-highlighting, description
  • Filters: remove-draft
  • Layout/UI: page-title (left), darkmode (left), search (left), explorer (left), graph (right), table-of-contents (right), backlinks (right), article-title (beforeBody), content-meta (beforeBody), tag-list (beforeBody)
  • Emitters: content-page, folder-page, tag-page, alias-redirects, crawl-links (with markdownLinkResolution: shortest), content-index, footer

Learned Lessons

Quartz v5 (released May 2026)

  • Config is quartz.config.yaml, not quartz.config.ts
  • Plugins installed via npx quartz plugin install from community repos
  • Color keys are lightMode / darkMode, not light / dark
  • Always verify plugin names against actual github.com/quartz-community repos
  • index.md required at content root or site shows blank/404
  • crawl-links must use markdownLinkResolution: shortest for bare [[wikilinks]] to resolve across folders
  • CF Pages routes are lowercase slugs — Folder/Hello.md/folder/hello

CF Pages setup gotchas

  • Create as Pages project, not Workers (new CF UI hides this)
  • Deploy command field is required — set to echo "done" to neutralize it
  • npx wrangler deploy (default) will overwrite your site with a Worker "Hello World"
  • /tmp wiped between CF builds — no caching possible except npm (auto-cached by CF if build caching enabled in dashboard)

Hallucinated plugin names (DO NOT USE):

frontmatter, component-resources, assets, static, not-found-page, github-flavored-markdown These are bundled internally in Quartz — declaring them causes install failures.

GFM note

GitHub Flavored Markdown is bundled inside Quartz core — no separate plugin needed.

Quartz-community confirmed real repos

backlinks, breadcrumbs, content-index, content-meta, content-page, crawl-links, darkmode, description, explorer, folder-page, footer, graph, note-properties, obsidian-flavored-markdown, og-image, page-title, reader-mode, recent-notes, remove-draft, search, stacked-pages, syntax-highlighting, table-of-contents, tag-list, tag-page, unlisted-pages, article-title, comments, canvas-page, bases-page, encrypted-pages, latex, created-modified-date, alias-redirects