Fix Quartz build to preserve git history for accurate file dates

Build Quartz from within the blumeops repo instead of copying files
to a separate location. This allows git to find file history for
the CreatedModifiedDate plugin, eliminating the "not tracked by git"
warnings.

Changes:
- Copy Quartz build system into workspace instead of vice versa
- Use symlinks for content and CHANGELOG.md
- Clean up build artifacts after creating tarball

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Erich Blume 2026-02-04 08:18:56 -08:00
commit 7a8e281dd7
2 changed files with 26 additions and 13 deletions

View file

@ -147,35 +147,47 @@ jobs:
echo "Node version: $(node --version)" echo "Node version: $(node --version)"
echo "NPM version: $(npm --version)" echo "NPM version: $(npm --version)"
# Clone Quartz # Clone Quartz to temp location
git clone --depth 1 https://github.com/jackyzha0/quartz.git /tmp/quartz git clone --depth 1 https://github.com/jackyzha0/quartz.git /tmp/quartz
cd /tmp/quartz
# Copy Quartz build system into blumeops workspace
# This allows building from within the repo so git can find file history
cp -r /tmp/quartz/quartz "$GITHUB_WORKSPACE/"
cp /tmp/quartz/package.json "$GITHUB_WORKSPACE/"
cp /tmp/quartz/package-lock.json "$GITHUB_WORKSPACE/"
cp /tmp/quartz/tsconfig.json "$GITHUB_WORKSPACE/"
cd "$GITHUB_WORKSPACE"
# Install dependencies # Install dependencies
npm ci npm ci
# Copy our configuration (lives in docs/ to keep repo root clean) # Copy our configuration to workspace root
cp "$GITHUB_WORKSPACE/docs/quartz.config.ts" . cp docs/quartz.config.ts .
cp "$GITHUB_WORKSPACE/docs/quartz.layout.ts" . cp docs/quartz.layout.ts .
# Copy docs as content (includes index.md) # Symlink docs as content (preserves git history for accurate dates)
rm -rf content ln -s docs content
cp -r "$GITHUB_WORKSPACE/docs" content
# Copy CHANGELOG.md from repo root into content so it's accessible in docs # Symlink CHANGELOG.md into docs so it's part of the content
cp "$GITHUB_WORKSPACE/CHANGELOG.md" content/ ln -s ../CHANGELOG.md docs/CHANGELOG.md
# Build # Build (from within repo so git commands work)
echo "Building static site..." echo "Building static site..."
npx quartz build npx quartz build
# Create tarball # Create tarball
TARBALL="docs-${VERSION}.tar.gz" TARBALL="docs-${VERSION}.tar.gz"
echo "Creating tarball: $TARBALL" echo "Creating tarball: $TARBALL"
tar -czf "$GITHUB_WORKSPACE/$TARBALL" -C public . tar -czf "$TARBALL" -C public .
echo "Build complete!" echo "Build complete!"
ls -lh "$GITHUB_WORKSPACE/$TARBALL" ls -lh "$TARBALL"
# Clean up Quartz build artifacts (keep tarball)
rm -rf quartz content 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
- name: Create release - name: Create release
env: env:

View file

@ -0,0 +1 @@
Fix Quartz build to preserve git history for accurate file dates