• ln -s '/Users/blairnangle/Library/Mobile Documents/iCloud~md~obsidian/Documents/notes' ~/personal/notes/content
  • Git project is ~/personal/notes/
  • GitHub project (with associated Vercel project) is blairnangle/notes
  • Symlink Obsidian iCloud dir to content rather than storing entire JS/TS project in iCloud as iOS Obsidian struggled with all the code, etc.

Staying in sync with Quartz

git clone --bare https://github.com/jackyzha0/quartz.git`
cd quartz.git/
git push --mirror https://github.com/blairnangle/notes.git
git checkout -b main
git push --set-upstream origin main
git remote add quartz https://github.com/jackyzha0/quartz.git
git checkout v4
git pull quartz v4
git checkout main
git merge v4
  • Symlink for local development
  • But won’t cut it with Git/Quartz as we need actual files in content on the remote so that Quartz (running in Vercel) can build our HTML, CSS and JS
  • So we have a deploy.sh wrapper script to handle temporarily replacing the symlink with the content from iCloud and pushing to remote
  • (Reinstate the symlink afterwards)
  • Fairly dirty solution (but it works)

Hosting on Vercel

Add a vercel.json file to the root of the project with the following:

{
  "cleanUrls": true
}

Using launchd to automate updating

The contents of ~/LaunchAgents/com.blairnangle.notes.plist:

<?xml version="1.0" encoding="UTF-8"?>  
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  
<plist version="1.0">  
<dict>  
    <key>Label</key>  
    <string>com.blairnangle.notes</string>  
    <key>OnDemand</key>  
    <true/>  
    <key>WorkingDirectory</key>  
    <string>/Users/blairnangle/personal/notes</string>  
    <key>StandardOutPath</key>  
    <string>/Users/blairnangle/personal/notes/stdout.log</string>  
    <key>StandardErrorPath</key>  
    <string>/Users/blairnangle/personal/notes/stderr.log</string>  
    <key>ProgramArguments</key>  
    <array>  
        <string>/Users/blairnangle/personal/notes/deploy.sh</string>  
    </array>  
    <key>StartInterval</key>  
    <integer>3600</integer>  
</dict>  
</plist>
~/LaunchAgents on ☁️  (us-east-1)
at 19:17:41, 2024-06-10
launchctl load -w com.blairnangle.notes.plist
~/LaunchAgents on ☁️  (us-east-1)
at 19:17:41, 2024-06-10
launchctl unload -w com.blairnangle.notes.plist

Resources