A New Beginning
I've been struggling for a long time to find an effective way to publish my ideas. I always find things to distracts from the goal of writing things. I thought that paring back to publishing a static web site would allow me to concentrate on writing. Upkeep of a publicly accessible software installation is time consuming, especially when the platform insists on breaking things in the name of innovation.
Organisation #
I've got a modest amount of content which I have published over the years. I decided to convert the data stored in WordPress into markdown files with metadata, rather than to discard the old stuff and start fresh. This involved a modified script which interpreted data from the WordPress export, allowing data hydration into the YAML frontmatter of each file. This does mean a lot of data has been pushed into the frontmatter in case it was needed later on. As things evolved, I learned to hydrate data based upon the data cascade and using directory structures. The code to configure 11ty is convoluted because of these early assumptions.
This means that I have some content which is essentially a single directory with files and metadata. More recent content is laid out differently. The 11ty configuration is a mess of filters and collections which attempt to rationalise the disparity between the two. I hope that my unsuspecting visitor doesn't notice that anything is weird about the whole situation.
It will require some effort to align old content, but I think organising the content within the repository would be a good place to start.
Writing #
You can write markdown files in any program that supports creating text files, but I want to get out of a code editor and use a tool which is more suited to the task. Obsidian uses the same format as the content I publish to my website (for the most part). Notes are Markdown files and YAML front matter, which is exactly what I need.
There are quite a few examples of people using Obsidian to publish 11ty sites, whereby the complete source is imported into your Obsidian vault. Incompatible files are hidden within the app. This could work but I haven't tried it in anger yet.
A few workflows that spring to mind:
- Bookmarking a page from an Android device with Obsidian Web Clipper
- Writing a page from iPadOS in the Obsidian app
- Previewing the site on Desktop from an IDE
- Content is added and updated directly in the repository via automations
Sync and Publish #
There are two problems that I can see with using Obsidian, but I don't think that they are insurmountable;
- How do I sync content between devices?
- How do I publish content changes to the web site?
Obsidian Sync #
I'm going to evaluate a hybrid solution to note synchronisation and publishing. I've begun by signing up for Obsidian Sync. Unfortunately the cheapest plan doesn't allow multiple vaults anymore, so I will have to limit my usage to a single use-case for now. If successful, the plan can be upgraded.
Publishing Content #
Publishing this site leverages Gitlab CI and Pages features. The content needs to be committed to a repository which triggers the site to be deployed. Obsidian git plugins exist to achieve this. They even work in mobile apps, though they seem to be inefficient.
I will need to experiment with different options here. It seems like different git options exist in mobile which may complicate matters. It was relatively simple to use git directly on a desktop machine, using standard tools to initialize a repository within the vault and configure the remote. On mobile this was much more difficult. You are forced to create the repository using obsidian actions, with no obvious feedback when things go wrong.
I had the foresight to ignore the .obsidian folder, so it was not pushed up to the remote. I strongly advise that, as it will delete and replace the vault version with the remotes version which may not be what you want. Obsidian will sync all that stuff, and whatever device I'm currently working on can be used to commit and push to the web, and I don't need to think about where I was last working on a particular piece of writing when inspiration happened.
That being said, I've managed to have two obsidian instances running, making updates to the content of a page. The page can be pushed from either running instance, and then the other is still able to pull changes from git without issue. The obsidian sync part is potentially redundant, but it does allow a simplified workflow as I don't have to push content until im ready.
I've made a few observations about workflow and pitfalls with regards to using git. If you are using a mobile device, you should be prepared to use a shell and be comfortable with git commands. Obsidian git on mobile seems to lack any support for resolving divergent branches (i.e. your remote main vs local). Alternately you can of course disable git on all devices except a desktop, which can take advantage of a fully-fledged git installation (instead of a JS implementation).
New Pipeline #
Rather than hosting the entire web site in the vault, I'm planning to leverage gitlab's ability to trigger downstream pipelines. The data from the content repository can be passed to the 11ty build and deployment pipeline as an artifact.
This will fix a long-standing issue I have had with this whole set-up. The code for the site is always a click away when trying to concentrate on writing. It's often too much of a temptation to tweak things a little. It will mean that for local development that I need to copy some data into the relevant folder, but it can just be ignored.