Skip to content
berry.sh
Go back

A Simple Guide to Managing and Publishing Articles with Obsidian

Edit page

A Simple Guide to Managing and Publishing Articles with Obsidian

Obsidian is a great writing environment because posts are just plain Markdown files. To publish them to a website, you need a way to (a) get those files into a static site generator (SSG) like Astro, Hugo, Jekyll, or Eleventy, and (b) deploy the result. This guide covers the three workflows that actually work in practice — pick whichever matches how much control you want.

Pick your workflow

Prerequisites (all options)


Option A — Git submodule workflow

This is the approach Bryan Hogan describes for Astro, and it generalizes to any SSG.

1. Create a content folder and turn it into a repo. Put your posts (e.g. blog/) and assets (e.g. blog-assets/) in one folder, then:

git init
git add .
git commit -m "initial content"
git remote add origin <your-content-repo-url>
git push -u origin main

2. Open that folder as a vault in Obsidian. Install the community plugin Git (formerly obsidian-git). It will pick up the existing remote — set a backup interval (e.g. 5 minutes) so commits + pushes happen automatically as you write.

3. Add the content repo as a submodule of your site repo. From the site repo root:

git submodule add <your-content-repo-url> src/content
git add . && git commit -m "add content submodule" && git push

The path (src/content here) should match where your SSG expects content — Astro uses src/content/, Hugo uses content/, Jekyll uses _posts/, etc.

4. Make the build pull the submodule. Submodules aren’t fetched by default on most hosts.

5. (Optional) One-button push from VS Code. Bryan’s tip: install the Tasks extension and add a tasks.json + a small script that commits/pushes the submodule and then the parent repo in one click. Saves the round-trip of committing twice for every change.


Option B — Vault-in-repo with auto-export (Jacob Kaplan-Moss’s pattern)

If you want “write in Obsidian, see it on the web in 5 minutes” with no manual steps:

1. Put the vault inside the site repo at e.g. vault/. Point Obsidian at that folder.

2. Install the Git community plugin with auto-commit and auto-push enabled. Set Advanced → Custom base path: .. so it commits at the parent repo level, not the vault.

3. Add a pre-commit hook (use Husky or any hook manager) that converts your vault to the SSG’s expected layout. For Hugo:

rm -rf content/*
obsidian-export vault/ content/ --frontmatter always
git add -A content/

obsidian-export strips Obsidian-specific syntax (wikilinks, etc.) and adds empty frontmatter so the SSG doesn’t choke. For Astro you can usually skip this step if you avoid wikilinks; for Hugo with nested sections you may also need a tiny script to create missing _index.md files.

4. Point your host at the repo. Every Obsidian auto-commit fires the hook, pushes, and triggers a fresh build.


Option C — Publishing plugin (no Git knowledge needed)

If you don’t want to deal with submodules or hooks, an Obsidian plugin can push selected notes for you. Add publish: true (or similar) to a note’s frontmatter and the plugin handles the rest.

Trade-off: less flexible than rolling your own, but no Git commands.


Practical tips that apply to all three

Which should you pick?

Sources


Edit page
Share this post:

Previous Post
Testing Claude Code Harnesses with Plugins
Next Post
Codex + git worktrees: avoiding index.lock in multi-agent workflows