I previously wrote about how I structure my blog inside my Obsidian vault, which I’ve been mostly happy with for over a year at this point. But I was ready for a restructure. The way I had my Obsidian vault set up to account for the blog was really odd, and I’m not sure why I put up with it for so long - I had all the blog content in the root of the vault, and everything else under a 00_private folder at the root. My Quartz build would just ignore everything under that folder. I don’t know why I didn’t just make a subfolder and point Quartz at that folder, instead of feeding it my entire vault.

But I also wanted to do a restructure of my blog, to fix the following annoyances:

  • Links were generated by taking the filename and replacing spaces with underscores (and some other special characters) - leaving case intact - meaning my links were long, ugly, and dependent on the filename. Any dash in the filename would look like this _-_ and any commas in the filename would get left in the URL. Not cool.
  • I had too many unnecessary nested folders. Previously it was blog -> yyyy-mm-dd -> post title and the blog directory would 404, as no index would get generated for it (because no files lived there).
  • Couple cleanups: font, enable graph view, update my versions of npm and Quartz
  • Reduce the size of my VPS for the blog (to pay less), because I had just spun up another one and I no longer used this one for testing like I had in the past with my Wireguard setup, etc.

Originally wanted to look into Hugo, but I realized that I’m more than satisfied with Quartz and I don’t really want to go to extreme lengths to get some of the features working - like full-text search. It does mostly everything I want it to, with minimal configuration. (I think eventually I will migrate to another generator, when I get the wherewithal to dive into the configuration, but I was already working on like ten other projects this weekend. So not right now.)

Side note - originally I spun up an IPv6-only VPS, because Vultr offers those for half the price of one with a dedicated IPv4. Something like $3/mo with auto-backups. But as I got further into the project, I kept running into issues. Like how the hell does github not support IPv6 at this point? We truly are doomed as a species. So anyway I upgraded to IPv4.

Vault restructure

Now the fun begins. I had upwards of 100 files to rename with all lowercase and underscores. I did not want to sit there for two hours doing this by hand.

So instead I spent two hours writing this legend of a one-liner to rename files in my blog folder (replace spaces with underscores, translate uppercase to lowercase):

find . -type f -exec bash -c 'mv "$0" $(echo "$0" | sed '\''s/ /_/g'\'' | tr '\''[:upper:]'\'' '\''[:lower:]'\'')' {} \;

The main trouble I had was the nested single quotes. Those are pretty awful. For future reference, you can nest a single quote like so: '\'' (end the first single quote, literal single quote by escaping with a backslash, begin a new single quote).

But then it turns out, since I did this the fancy way outside of Obsidian, I had broken all the links to my blog posts or manpages. So I had to go back through them all by hand anyway and fix the links.

In the end, this is the Vault structure I was left with, and I’m fairly happy with it:

├── 00_inbox
├── 10_journal
│   ├── 00_daily
│   ├── 10_weekly
│   ├── 20_monthly
│   └── 30_yearly
├── 20_notes
├── 30_blog
│   ├── about
│   ├── blog
│   ├── man
│   └── public
├── 70_data
├── 80_misc
├── 90_archive
├── 98_resources
└── 99_templates

In the Quartz build script I now take the 30_blog folder as the input folder instead of the root of my Obsidian vault. Again I don’t know why I didn’t think of this ages ago. Such a stupidly easy solution.

Other than that, outside of the several hours it took to deploy the new smaller VPS, I didn’t do much besides changing a couple configuration options and clean up the build/publish scripts on the blog side.

Syncing my Obsidian vault

Now that my Obsidian vault was more suitable for note-taking and journaling, I wanted to take a stab at Obsidian LiveSync again. I had set it up a while back (actually on my old website VPS), but got completely lost. I tried it again, got it fully “working”, and suffice it to say that it’s not for me. Absolute pain in the ass to configure, mysterious options, will eat your homework and your cat. The dev does a lot, and I agree that sync is a lot harder than people give it credit for (there’s a Github issue where he goes way into depth, but I can’t find it now), but this is just too much of a headache.

I ended up taking a stab at a WebDAV server via Docker, and using the Remotely Save plugin. This ended up being a lot harder than it should have been. I sat there and screwed with the reverse proxy configuration (this config was helpful) for a solid hour before realizing that the error I was seeing was caused by a Docker permissions issue instead of a reverse proxy issue - something I could have solved in 30 seconds by changing the ownership of the data directory. Anyway, this ended up working, and I am more than satisfied with it.

Now on to trying WebDAV for phone backups (and probably other things)!

EOF