Obsidian is an open source markdown note-taking tool. It's minimal, it's super simple, it's works flawlessly for all kinds of content writing (if you're a fan of markdown). I've used it for a few years for basically everything.
This setup makes it much easier and frictionless to write content, especially since I'm able to utilize Obsidian plugins and all of its other awesome features.
Eleventy is used as the static site generator for this site. Inside my posts collection folder I've opened a Obsidian vault. Each new post consists of a markdown file and an image folder.
I'm using the Obsidian templater plugin to generate new posts with default frontmatter meta data that Eleventy uses. Images are directly pasted into a post and are automatically saved to the image subfolder of the post.
I'm also able to modify Obsidian to my liking using CSS snippets. Having a beautiful writing experience makes writing more fun.
This website is split into a few collections of content:
Each section is placed in its own content folder. Projects and Templates are rarely updated and are therefore not needed to integrate with Obsidian right now.
Posts, however, is a collection that I intend to update regularly. That's why I've created a new Obsidian vault inside this folder.
A post consists of:
Inside VSCode it might look something like this:
Inside Obsidian it might look something like this:
Frontmatter contains all the meta data of a post. In my case, the frontmatter for each post consists of:
This is needed for Eleventy to understand how to categorize a post, where to display it and so on. It's also needed for SEO-reasons and reading experience etc.
In Obsidian, frontmatter variables are called attributes. These can be added manually to a document through its settings. This is however very time consuming and boring, so that's where the first Obsidian plugin comes in handy.
I just recently found out about these amazing resources. The Obsidian community seems to be very active in developing plugins that solve even the most niche problems. These are easily installable through the software itself.
The templater is a plugin that can automate lots of stuff. I'm however using it for one thing and one thing only - to create new posts from a template.
This template is a simple markdown file located in a templates folder in my vault. It looks something like this:
It's a default post with all needed attributes (frontmatter) that I can duplicate on demand.
In order to create a new post, I'll create a new folder and use Obsidian's quick command thingy (ctrl + p), and find the templates: insert template button.
All images gets automatically saved inside a subfolder called img. The default location of saved images can be configured in the settings.
There isn't any official markdown image caption syntax that renders HTML figure & caption elements. This can however be fixed by installing the NPM package markdown-it-image-figures and configure it with 11ty.
You can find a full guide for this over here (written by Al Power). There are a couple things not mentioned in the guide though:
Naming images seems to be important in order for Obsidian to find the relative path to them. Why? I don't know. But you basically have to name them without spaces etc.
That's when the Paste Image Rename plugin comes in handy. Obsidian names images in strange way as a default. This plugin simply prompts you to name each image when pasting it in. Great.
I'm using Github & Netlify to store and deploy this site. Each commit gets pushed to my Github repo which in turn triggers Netlify to rebuild the site.
I know that there is a Git plugin for Obsidian that could automate pushes and therefore act as a publishing "button", but I haven't had time to take a look at that one yet.
Instead I just manually push changes every now and then through my terminal for now.