Digital Garden Implementation
2024-07-18
continued in:
[decadv_2024_02]
[decadv_2024_03]
[decadv_2024_04]
So, I have an idea for a blog system that would nicely integrate with my current obsidian setup.
I have found Obsidian to be an incredibly useful (albeit closed-source) tool for my usecase. I use it to track everything. Personal issues, feelings, game reviews, technical documents, worldbuilding exercises, life plans, so on and so forth.
There is a lot written here. I feel like some of it may be useful to other people as well, but I can't share everything I put here.
So, I'm thinking of making a system that would allow me to pick and choose what gets uploaded, within these markdown files.
Requirements
From a technical standpoint, it would be something like a cronjob that scans every file within this directory, copies it all over to a git repository, perhaps with a md-> html conversion somewhere in there and uploads it to a git host that is also able to do static web pages.
Another requirement would be the ability to have a tree view like the one I have here in Obsidian. I find it to be a very good way to overview everything I have.
I'd also wish for all of this to be light, in every aspect of that word, i.e it would have to pass the neauoire test (can it be browsed on a pinebook on a mediocre satellite connection while sailing the pacific?)
Possible Solutions
So, as for detecting what to upload and what to ignore, i'd probably go for a simple tag within every file that is to be published. i.e something like # publish.
Obsidian automatically knows it's a tag and it would probably take a simple grep
to find it within a file reliably.
I'm not sure what I would use for file conversion. I'm not particurlarly keen on writing my own markdown converter, so i need to do some research there. Best bet would be to use something like pandoc, i guess.
Which leads into my next choice. Given that I am using pandoc, it would probably be best to use a language that works well with it. Using shell scripts seems like the way to go, considering that i'd have immediate access to git and to pandoc.
I've also looked at possible direct alternatives to Obsidian Publish, one of whom which piqued me the most being Mind Stone
. It seems like a good fit but ultimately it misses one of my requirements, that being the ability to conveniently 'whitelist' what I want uploaded.
The working concept
So, to quickly outline how this whole thing is supposed to work in my mind:
- Syncthing gets an updated copy of my obsidian vault
- A cronjob that runs every hour or something runs a shell script, which:
- Goes over every file within the vault, looking for files that contain a publish tag.
- For every file that contains a publishtag, copies it over into another folder, somehow figures out it's path, and..
- makes a user-navigable tree of all files found, using
<details>
- Templates out every markdown document and turns it into a nice-lookin page
- uploads page to pages.sr.ht or something
Incoming: [decadv_2024_02] [decadv_2024_init]