Transition to Hugo
By Austin Lane
I’m trying out a new platform for hosting my writing. Ghost was nice, in that it was simple and easy to write down a post, make it look clean, and had some convenient integrations/embedding tools. What I didn’t like was a lot of the focus on Substack-style newsletter audience building and monetization. Not what I want to be doing here. Modifying themes was kind of a pain too.
NetworkChuck just put out a cool video going through his new plan to put out a blog with a tool called Hugo. I was instantly on board because it did what I wanted from the beginning - make a super lean static site that I could just host with NGINX. I want something fast and responsive, and it doesn’t get much better than a bunch of static HTML and CSS. It will take a directory of Markdown files and convert them to pages, so if you have a way to get those files into the content directory you just run the hugo
command and you’re set. I liked Chuck’s whole setup except I wanted everything to be web-based, including the writing part, and his depends on a desktop app called Obsidian. I modified the big script that he provided (I also don’t need to go through Github or push to an external host) so that it copies posts written in Flatnotes
and then builds with hugo
. That’s it. Since the folder is mounted in an NGINX container it just instantly shows up on the site.
One hiccup was being stuck on an old version of Hugo, the Debian apt
archives seem to be way out of date, and a bunch of themes were broken until I just manually downloaded the package from Github.
Two things to sort out - first I need to get attachments in the right place so images show up on the hosted site. If i upload through Flatnotes
and leave it as is, my script will copy the images but the markdown link is broken. I have to modify it so it’s broken in the editor view, but it ends up working on the blog. Feels hacky. After that I think I can create a flow in n8n
that will log in and execute the publishing script. I could probably just have that triggered from a dashboard button or something. The question is whether that is any less effort that just using ssh
to connect to the server and run the python script. If Flatnotes
had a way to trigger a callback script on saving a file this would be automatic, but that kind of integration goes against it being a simple note editor and probably won’t ever happen unless i just modify the code myself and add that in. Again, way more effort than ssh
.
Next on my list is to take a look at a service called MediaGoblin. I think this will really solve the images issue, as I won’t have to upload anything through Flatnotes and get it copied over to the right static content direct. I’ll manage everything there instead and just hotlink from the blog. As a bonus, I can probably replace soundcloud embeds here with music on there as well and keep this whole project on the self-hosting path.
Today’s header - Gary Numan