Obsidian is my favorite note application. It simple yet powerful. When I first discovered it I really got into the weeds with figuring out all the keyboard shortcuts , exploring all the plug-ins that were available, And linking all my notes together with the mind map feature. But that was back when I was studying for Security+ I’ve cut back on that as of recently and just started writing notes like a normal person.
I also just really needed to get into the habit of writing things down rather than just trying to remember everything.
I actually stole this idea from Network Chuck. In his video which I will link he developed some software that would turn his obsidian notes from markdown files into HTML code, passing them to Hugo to make them more visually appealing, pushing it to his Github and then finally having his webhost retrieve the files to display them on the website.
I thought this idea was interesting but much too complicated for me. Also I’m not going to lie, as much as I love Chuck’s videos and appreciate him for introducing me to new technologies and most importantly teaching me the basics of Linux. I don’t know if I’m just incompetent or things just change too much by the time I get around to trying to re-create one of his tutorials they almost never work.
I put Claude to work developing a Python script that would convert markdown files and send them to my website. I’ll be honest in Chuck’s example his webpages looked very nice, but I did not want to go through the whole rigmarole with Hugo and having to integrate everything. This is a final test/verification of how these markdown files actually look within my website. I did some slight format testing but I don’t know how post work in comparison to how I originally wrote them in the Gutenberg editor previously. But I have high hopes since my website is very minimal as you can see.
The principal was still the same I have a dedicated folder in my Obsidian vault for website posts with a custom template that will help me set the category for the post. Additionally, website posts will inherit the note title. The main difference is as I mentioned previously I won’t be passing the markdown files to Hugo but I also won’t be publishing my post on Github.
There is a copy of the project on there though and it doesn’t have any crazy dependencies so go ahead and tested out. I attached a full setup guide that will walk you through everything. The only thing you’ll need is a Windows computer, python 3.10 +, Obsidian and a website. And if you don’t have a website you should get one. If you search up local WordPress there is a piece of software you can use to run a WordPress site on your local hardware. You can play around with it and build something, see how you like it before you commit to buying any hosting space. It’s actually what I used in the beginning. Hosting space can be cheap if you find a good deal. I forget how much I paid for mine but it was at a crazy discount. But once my 4 year term ends it will be something crazy like $500 a year which obviously I’m not paying. I actually might end up just buying a little bit of hosting space in the cloud and just setting up a web server by myself. I would have to do some research first. It would definitely be cheaper no more than probably $5 to $10 a month.
One word of advice if you end up using local. Whatever starting configuration you choose make sure to install the WP all-in-one migration plugin. It will help you migrate your files over to your hosting platform and take backups which you should be doing quite often.
My process was a little bit more complicated since I host my vault on my NAS but if it’s on your local machine it’s very simple to set up.
Future feature
There is another version on the Github repo that has logging and does work. Only thing is if you try to use it make sure to take out the _test portion of the filename. I really wanted to have the log file in the obsidian vault itself but for whatever reason it was not writing to the file and trying to fix it broke everything. Which is unfortunate because I really wanted to make writing as frictionless as possible and not have the user bouncing between obsidian and their web host. Eventually I would like to go back and implement this properly but to be honest there’s only a handful of issues you can run into.
- Wrong filename
- Improperly configured shell command
- The note not being in the correct folder
- Invalid or missing credentials
- Wrong site URL
- Site being down/no network connection
- Removing or changing the wp-id
Also another feature idea would be adding an error status code because as it stands right now, if there’s something wrong your key bind will still switch to status to published or draft even if there’s an issue stopping it from being displayed.
Also having a way to disable comments from here would be nice. The Russian bots are undefeated.
I submitted this post is a draft to see what would happen if I just posted the raw YouTube link to Chuck’s video. The link showed up in the post but it wasn’t blue and there was no embedding. Even though I can easily embed videos within obsidian unfortunately they don’t actually show up on the post itself……. Is what I would’ve said a couple hours ago. I updated the script to accept both the obsidian syntax and raw links. The reason I did this was because I wanted the final product to be as close to the note as possible so there wasn’t any confusion.
All that’s it for now, I hope if any of you use it helps you out. I’m pretty happy with it.