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
This commit is contained in:
Erich Blume 2026-02-04 08:46:47 -08:00
commit 95610d8e54
2 changed files with 7 additions and 9 deletions

View file

@ -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: