Using Obsidian with Eleventy (11ty) and local deployment
My current workflow is to edit my notes in Obsidian, and use Eleventy (11ty) to compile static website files. Here’s how it works.
Working from an existing site with lots of content
I’ve had this website since 2002, and have amassed a lot of stuff since then. I didn’t want to start over from scratch, though I was very tempted after seeing Teresa Watts restart her site from scratch. So clean! Such konmari! 🐕
But upon reflection, I realised what I really wanted was that my working environment be clean – a fresh, empty Obsidian vault where I could think without clutter. By definition, a mind garden/digital garden is supposed to be messy, full of idea seeds that grow and intertwine over time. To extend this metaphor, I consider this new (as of Feb 2025) workflow my worktable in the midst of a rampant digital swamp.
With a new, empty Obsidian vault created, I followed Timothy Miller’s advice to create a symlink to my website folder inside my vault, then went to Options > Files & Links > Excluded Files to add my node_modules/
and deployment folders to the Excluded Files.
Now I can do all my writing and thinking in a clean vault, while still easily referencing my website content from within Obsidian. Note this works for content only. Obsidian won’t open HTML, NJK and CSS files.
Local build, local deployment, something like that
When my updates are ready, I run a custom build script on my local machine to get 11ty to compile my website in a local deployment folder for my static site.
Then I run a custom deploy script to publish the files in the deployment folder to my server. All done!
It’s straightforward and meets my needs. Most of the Obsidian-to-publish solutions out there optimise building and publishing to a server on the internet somewhere, which didn’t appeal to me. I didn’t want to be so tightly coupled with a specific platform or the cloud.
But my dinky approach works because I don’t update frequently or pre-schedule content, and sometimes I like to batch a bunch of updates over weeks/months before actually publishing my changes.
Workflow in summary
- Create a new Obsidian note (or edit an existing one)
- Insert an Obsidian template with my standard frontmatter
- Move note to my static site folder
- Run build & deploy scripts to publish to sanlive.com
Stuff Obsidian needs
- A way to omit
node_modules
and your deployment folder if you symlink your entire static site folder. You can configure this in Files and links → Excluded files. Just add the undesirable file paths on your local machine.
Stuff 11ty needs
- A way to convert Obsidian’s internal wikilinks format to markdown links for 11ty. I use
markdown-it-wikilinks
– there are a few forks out there, so pick your favourite.
I think that might be it, but if I discover I’m wrong about that, I’ll update this note.