yuki's notes

automating obsidian to github pages

#Automation #Obsidian #Hugo

goals

architecture overview

1obsidian vault
2  -> powershell deployment script
3  -> wsl hugo project
4  -> hugo build generates public/
5  -> git push main
6  -> git subtree split public/ to gh-pages
7  -> github pages deploys the published branch
8  -> yuuu.uk serves the final site

how the setup is organized

the source of truth is the obsidian vault at e:\icloud\iclouddrive\obsidian\notes.

inside that vault:

the hugo site lives in wsl at /home/ubuntu/blog/blog. the deployment script copies content from the obsidian vault into the hugo project before each build.

the deployment script

the deployment script is a powershell entry point, but the actual hugo and git work runs inside wsl because the site itself is stored there.

when i run the script, it performs these steps:

  1. it validates the required paths and checks that rsync, hugo, and git are available in wsl.
  2. it mirrors obsidian notes into content/notes with rsync --delete, so deleted notes are removed from the hugo content tree as well.
  3. it syncs site pages from pages/ into hugo’s content/ directory, which makes the homepage and other section pages editable from obsidian.
  4. it copies image attachments from the obsidian vault into static/obsidian, while excluding obsidian metadata folders and trash.
  5. it normalizes image filenames into lowercase, hyphenated slugs and rewrites obsidian embeds such as ![](/obsidian/image.png) into standard markdown image links that hugo can publish reliably.
  6. it builds the site with hugo --minify --buildFuture, which also allows future-dated notes to be rendered.
  7. it stages, commits, and pushes the source repository to main over ssh.
  8. it publishes the generated public/ directory to gh-pages using git subtree split, and github pages serves that branch.

github setup

why this workflow works well

this setup keeps each tool focused on one responsibility:

that separation keeps the workflow simple: write in obsidian, run one script, and let the deployment branch update the live site.

operational notes

a few details are important for long-term maintenance:

result

the result is a manual but reliable publishing pipeline.

i can write notes and pages in obsidian, paste images directly into notes, run one powershell script, and publish the updated site through github pages without opening the hugo project manually.

the deployment is not literally instant, but once the script pushes the updated branches, github pages usually refreshes the site after a short delay.

references

<< Previous Note

|

Next Note >>