Hugo file GenDash: Obsidian to Hugo Automated Publishing Guide
This guide outlines the infrastructure and configuration required to sync an Obsidian vault across multiple devices and automate the publishing process to a Hugo website via Cloudflare Pages.
1. Multi-Device Sync (The Git & Web Layer)#
To sync your notes between computers and view them on mobile devices without the overhead of real-time database sync engines:
1.1. Between Computers (Mac Studio & MacBook Pro/Air)#
We use the Obsidian Git plugin to synchronize GenDash vaults directly via GitHub.
- Repository:
git@github.com:marcoue/GenDash.git - Shortcuts:
Cmd + S: Commit & Push local changes to GitHub.Cmd + Shift + S: Pull remote changes from GitHub.
1.2. On Mobile Devices (iPhone & iPad)#
To avoid complex sync engines and conflict loops, Obsidian is not installed on mobile. Instead, notes are accessed via the browser using the self-hosted Hugo GenDash website:
- Read Access: Simply browse your local Hugo GenDash web server instance. It provides instant, formatted, searchable access to all your notes with zero configuration, zero battery drain, and zero storage overhead on your phone/tablet.
2. The Content Bridge & Git Publisher (Mac to Web)#
The publishing pipeline is consolidated into a single master script run from your Mac Studio. It handles preprocessing multilingual notes (converting Wikilinks and processing images), syncing them to the Proxmox VM, triggering the Hugo build/deployment, and backing up your GenDash vault to GitHub.
Location: /Users/marc/Scripts/MacOS/sync-obsidian-gendash-hugo.sh
A mirror copy of the script is also maintained at
/Volumes/Software/Software/Scripts/MacOS/
2.1. Script Execution Workflow#
Running the script executes the following sequential steps:
- Processes Markdown: Parses local
en,fr, andesnotes into/tmp/gendash_syncto convert Obsidian wikilinks[Page Name](/posts/page-name/)andinto standard Hugo relative markdown links and image paths. - Syncs Content: Runs
rsyncto mirror the processed notes and images to the Proxmox Hugo VM. - Triggers Deploy: SSHs into the VM and runs the remote publication script (
publish-hugo-gendash.sh), pushing built site changes to GitHub to trigger Cloudflare Pages. - Backs Up Vault: Git commits and pushes your local GenDash vault to GitHub (
GenDashrepository).
If any step in the pipeline fails, the script aborts immediately to prevent desynchronization.
2.2. Command Usage#
- Full Sync, Publish & Vault Backup (Default):
pushgen # (Alias for: bash /Users/marc/Scripts/MacOS/sync-obsidian-gendash-hugo.sh) - Sync-Only (No Build / No Git Backup):
pushgen --sync-only # or: pushgen -s
2.3. Configuration & Alias Setup#
To configure the pushgen alias on your Mac Studio:
# Add alias to ~/.zshrc
echo "alias pushgen='bash /Users/marc/Scripts/MacOS/sync-obsidian-gendash-hugo.sh'" >> ~/.zshrc
source ~/.zshrc2.4. Mac Studio Cron Schedule#
If you want automatic syncing and deployment on a schedule:
crontab -e# Full publish & backup at 12:10 PM and 8:10 PM daily
10 12 * * * bash /Users/marc/Scripts/MacOS/sync-obsidian-gendash-hugo.sh > /dev/null 2>&1
10 20 * * * bash /Users/marc/Scripts/MacOS/sync-obsidian-gendash-hugo.sh > /dev/null 2>&13. The Remote Build Script (Linux VM)#
The remote Proxmox VM hosts the source files and publishes changes to the GitHub GenDash repo.
Location: /mnt/Software/Software/Scripts/Linux/publish-hugo-gendash.sh
You do not need to SSH to run this script manually anymore, as the Mac
pushgenscript triggers it over SSH automatically. However, the VM cron schedule still runs independently as a backup.
3.1. Proxmox VM Cron Schedule#
# HP1Docker cron job
crontab -e# Build and publish Hugo site at 12:15 PM and 8:15 PM daily
15 12 * * * bash /mnt/Software/Software/Scripts/Linux/publish-hugo-gendash.sh
15 20 * * * bash /mnt/Software/Software/Scripts/Linux/publish-hugo-gendash.sh