From 95610d8e5490358e205622277ffc9e5a6f2abf79 Mon Sep 17 00:00:00 2001 From: Erich Blume Date: Wed, 4 Feb 2026 08:46:47 -0800 Subject: [PATCH] Fix Quartz build to preserve git history for accurate file dates (#106) ## Summary Fixes the "isn't yet tracked by git, dates will be inaccurate" warnings by using Quartz's `-d docs` flag instead of symlinking. ## Problem The previous approach symlinked `content -> docs`, but git doesn't follow symlinks. When Quartz asked git about `content/index.md`, git had no history for that path. ## Solution Use `npx quartz build -d docs` to tell Quartz to read from `docs/` directly. Now when Quartz asks git about `docs/index.md`, git finds the actual file history. - CHANGELOG.md is copied (not symlinked) into `docs/` for the build, then removed - All other files have accurate git-based dates ## Testing Tested locally - build produces no warnings. Reviewed-on: https://forge.ops.eblu.me/eblume/blumeops/pulls/106 --- .forgejo/workflows/build-blumeops.yaml | 15 ++++++--------- .../fix-quartz-content-directory.infra.md | 1 + 2 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 docs/changelog.d/fix-quartz-content-directory.infra.md diff --git a/.forgejo/workflows/build-blumeops.yaml b/.forgejo/workflows/build-blumeops.yaml index b44b46f..89f84f3 100644 --- a/.forgejo/workflows/build-blumeops.yaml +++ b/.forgejo/workflows/build-blumeops.yaml @@ -166,15 +166,12 @@ jobs: cp docs/quartz.config.ts . cp docs/quartz.layout.ts . - # Symlink docs as content (preserves git history for accurate dates) - ln -s docs content + # Copy CHANGELOG.md into docs so it's part of the content + cp CHANGELOG.md docs/ - # Symlink CHANGELOG.md into docs so it's part of the content - ln -s ../CHANGELOG.md docs/CHANGELOG.md - - # Build (from within repo so git commands work) + # Build using -d docs so git can find file history at correct paths echo "Building static site..." - npx quartz build + npx quartz build -d docs # Create tarball TARBALL="docs-${VERSION}.tar.gz" @@ -185,9 +182,9 @@ jobs: ls -lh "$TARBALL" # Clean up Quartz build artifacts (keep tarball) - rm -rf quartz content public node_modules + rm -rf quartz public node_modules rm -f package.json package-lock.json tsconfig.json quartz.config.ts quartz.layout.ts - rm -f docs/CHANGELOG.md # Remove symlink + rm -f docs/CHANGELOG.md # Remove copied file - name: Create release env: diff --git a/docs/changelog.d/fix-quartz-content-directory.infra.md b/docs/changelog.d/fix-quartz-content-directory.infra.md new file mode 100644 index 0000000..9bf0f6e --- /dev/null +++ b/docs/changelog.d/fix-quartz-content-directory.infra.md @@ -0,0 +1 @@ +Fix Quartz build to use -d docs flag for accurate git-based file dates