data engineering
Contact

This post was written in markdown

Feb 13, 2024

Every few years, I re-launch this thing I loosely call a blog.

And every time, the part I dread the most is creating the CRUD related to post management. It's not hard, it's just tedious.

And it's no fun writing content in a homemade CMS.

But I do like a challenge. So I decided to implement my ideal content creation workflow: write content in an Obsidian vault and sync that to this website. Let's get into it...

The website

  • This is a Laravel 10 back-end and front-end (blade templates).
  • Why not a js framework? I don't have time to re-learn js frameworks every time I need to make an update. Laravel is dependable and good enough for my purposes. Skill issues, I know.
  • MySql database. The posts, upon being updated are synced to the database. I could have gone without a database entirely.

The content

  • Content is written in markdown, using Obsidian.
  • When pushed to GitHub, a job is triggered to run git submodules update --remote on the website.
  • There are separate directories for draft and published in the Obsidian vault, which determines visibility.

The syncing

  • The same job above that updates the submodule repo on the website also triggers a console job to sync the markdown files in the database.
  • I use slugs as primary keys, based on the filename in Obsidian. Since you can't have two files with the same name in the same folder in Obsidian, this ensures I can't publish a post with a duplicate slug.
  • The published_at date is set when a post is published for the first time.

What could be better

  • I don't have an easy way to preview a post before hitting publish, but I don't see this as a major issue.
  • I'm not sure yet how images/multimedia will be displayed.
  • I still need a tool to upload/resize images for the web. Luckily I've done this about 10 different times so have the necessary logic. Images will likely have their own table in the db and be uploaded outside of Obsidian.
---
Last update: Feb 17, 2024
Privacy