My Blog Configuration

Published on Fri Feb 23 2024

5 min read

[!tip] This project is very much alive! I’ll come up with a better way to make this obvious later 😉

Blog TL;DR Diagram

My Blog Setup: Obsidian + Scripts + Astro

I use a piece of software called Obsidian daily. It’s an extendable markdown editor, with an emphasis on the power of linking your notes via wikilinks, and stores all of your “notes” locally. I use it to manage projects, my digitally-adapted Bullet Journal process, my Morning Pages, general note-taking, and now, blog posts, too.

Obsidian affectionately refers to a directory of notes as a “Vault.” I’ve found that keeping all of my writing in the same Vault gives me an opportunity to link notes together that cross domains, span the spectrum of completeness, as well as ones that should and shouldn’t be shared with others.

Knowing that I wanted to keep my highly tailored setup but begin to selectively publish works of writing has caused me analyze a few different options.

Obsidian Publish

Obsidian offers a service called Obsidian Publish, which makes it incredibly easy to selectively publish Obsidian notes to a website. This is great if you want to share your notes, making it a top choice for digital garden enthusiasts. Here are a couple of examples of sites created with Obsidian Publish:

Open Source Alternatives

I thought about using Obsidian Publish to publish my notes, but with a little Googling I decided against it. For starters, Publish costs $8 a month. I think that’s a very fair price — if you’re passionate about publishing about any topic than I think this is a great option. But I’m a developer after all, and this felt like a fun project to build myself.

Before setting up my own system I found that other developers have taken up this custom publishing process, too:

These open source alternatives are impressive, and you should definitely check them out if you’re interested in setting up something similar.

My Setup

I’ve been wanting to get more familiar with Astro and this project seemed like a perfect case to do so. This also gives me total control of our blog setup, which I find necessary in order to address a few matters:

1. The Digital Garden Problem

As I’ve journeyed across different individuals’ published notebooks, I’ve noticed a “signal” issue. When you’re publishing hundreds of links to different ideas and notes, it can become difficult to know which pieces are polished and featured, versus notes that may contain simple ideas or references to another piece of work.

For this reason I’ve tried to separate the noise (notes) from the pieces I think are more interesting for site visitors (posts). I can always expand on this taxonomy later; perhaps I’ll add a designation for projects?

More recently I stumbled across Hermitage Digital Garden which offers their own solution to this signal-to-noise predicament. The author uses “maturity levels” to classify writing from just an idea, called a sapling, to a mature and fully-developed piece, called a tree. I might try to adopt something like this myself in the future. If so, I’ll update that bit here!

2. Resolving Transparency & Privacy > A Helpful Script

Astro uses a reserved directory called collections that you can populate with markdown files as your content. With this in mind, I originally thought I would just move my Obsidian notes into the collections directory. Then I could use each note’s YAML front matter to indicate which should be published. Voilà, we have selectively published writing.

However, I mentioned before that my notes include more than just blog posts and public thoughts. If I moved my Vault into the source code of the website, then even private notes would be committed to the .git history of the project. There are ways to tell Astro to omit these private notes from the build process then would know to omit these private notes from the build process, but you all could still access the markdown files. Of course I wanted to make my blog’s source code publicly available, so I needed to figure out to solve for this issue.

Thankfully, I found this very helpful post from Rach Smith’s digital garden with a link to a Node script that she wrote enabling you to copy files from your Obsidian notes directory into your Astro site collections directory. I spent some time rewriting it in Typescript and adapting it for my setup. It’s a bit of a mess at the moment, but it’s working!

This script may become more of a project, if so —> A more technical deep dive on this script

The Setup

  1. I continue to write every day in Obsidian, which stores the markdown files in path/to/Obsidian and any attachment files that I bring in at path/to/Obsidian/Attachments (You can set this behavior up in Obsidian).
    1. Any note for the public just needs published: true in the frontmatter.
    2. Any post needs the aforementioned boolean as well as isPost: true
  2. I open my website project code ~/Development/blog and run npm run import. This updates my collections/notes and collections/posts with the publishable works.
  3. I check the git diff to personally validate the changes. Commit, publish, and let Netlify handle the build and deploy process!

Final Word

Special thanks to the authors and developers who have also tackled this custom publishing process; I’ve definitely piggybacked off of your ideas in different ways! Feel free to clone the repo and contact me on Twitter if you find this stuff interesting. I’m happy to connect with anyone about this nerdy stuff 🤓