This site is essentially an Obsidian vault which is published using Quartz 4 . Most users of Quartz would have initialised a site in their Obsidian vault, but I had no interested in doing likewise. I wanted this vault to contain only my notes, plus one or two Quartz configuration files.
The way I’ve chosen to have this site setup is as follows:
- An Obsidian vault containing the notes that I want to publish, plus one or two Quartz config files.
- The notes of the vault and the config files are checked into a Git repository
- The repository also has a Forgejo workflow
- Pushing my changes to Forgejo will start the workflow which will install Quartz, create the site, build the site, and upload it to Netlify
Post Dates
On the whole this works rather well, but I noticed that the page dates were not being preserved. They were all being set to the last time I built the site. After some false starts changing the CreatedModifiedDate plugin, I learnt that Git doesn’t preserve the original file timestamp. Since Quartz was using a fresh clone of my vault, it explains why the dates were always changing.
I found a fix for this by using git-restore-mtime. There exists a Github Action for this, but since I’m using Forgejo, I’d figured I make my own. My workflow YAML file ended up looking something like this:
jobs:
publish:
runs-on: docker
steps:
- uses: actions/checkout@v3
with:
path: content
fetch-depth: 0 # required by restore-mtime
- uses: actions/setup-node@v4
with:
node-version: 22.18.0
- name: Install dependencies
run: |
# Excluded an annoying workaround for NPM not being able
# to install nelify-cli because a directory was not empty
npm install netlify-cli -g
apt update
apt install -y python3 git-restore-mtime
- name: Restore mtime
run: |
( cd content ; git restore-mtime )
- name: Install Quartz 4
run: |
git clone https://github.com/jackyzha0/quartz.git
cd quartz
npm i
- name: Prepare Site
run: |
# Some quartz config is checked into the vault repository. This
# step deploys them to the new quartz site
cp -r content/.quartz/* quartz/.
cd quartz
npx quartz create --source ../content -X copy -l shortest
npx quartz build
- name: Deploying to Netlify
run: |
netlify deploy --dir quartz/public --prod
Furthermore, in quartz.config.ts
, you want to make sure that:
- The
CreatedModifiedDate
plugin hasfilesystem
as one of the priorities. - The
defaultDateType
property is set tomodified
After a few false starts, and the obligatory fighting with NPM, the post dates should now be preserved. This means that RSS should be working now.