As I alluded to in my article about Obsidian, I am very fond of editing my text in neovim. Naturally, if you want to edit in neovim, you need to have your text as local files. I keep all of my personal notes in markdown.
Previously I was using WordPress, but the editing and writing experience became torture which I could not endure any longer. I looked for a different solution that would allow me to edit my files locally instead of in the browser.
I discovered Hugo and I fell in love with it immediately.
Hugo is a static site generator based on markdown files. My entire blog is written in markdown files which are stored in a GitHub repo.. I write my blog posts in vim and when I’m done I use Hugo to generate the updated website.
The result is what you see in the “public” directory in the GitHub repo. This public directory is pushed to a different repo which is hooked up to my hosting provider. My hosting provider uses Plesk, and with Plesk I have the option to connect the GitHub repo to the web server with a webhook. When I push to my hosting repo, the contents are gathered by the webserver and served as public web content.
My complete writing and publishing workflow looks like this:
- Create a new markdown file
- Write the note or article
- Save the file and run the “hugo” command to regenerate the website
- Run the “publish” script. This is a custom script I wrote that takes the contents of the “public” directory to my hosting repo
- Push the newly generated website to the hosting repo
- And we’re live! 🚀 🎉
It is such a smooth and convenient process. I can literally have a new note published to the interet within a few minutes, and it is all done from the command line using my favorite tools.