A new Blog!

Prepare for a boring post about blog software!

Heya Folks! I decided to try out a new blog software, I found myself wanting to write posts in something more MarkDown like, and Wordpress didn’t have very many good options for a MD editor with proper syntax highlighting. I’ve been writing a lot of MD for our git repos at Tigera, and code examples on Slack, and other places. I did some digging and came very close to grabbing Jekyll, but after some research I ended up landing on Hexo.

Overall Hexo is pretty nice, especially if you enjoy writing in MD. You do loose some niceities like WYSIWYG, and a singular interface for managing everything, but if you’re anything like myself it won’t really bother you to need to write your posts in some text editor (I am currently using VSCode, as it does have a MD preview) rendering the html, then pushing it to your servers, it’s just another chance to write more scripts! You also loose the native comments in WP, but Disqus is extremely easy to tack on to most sites, and Hexo makes it as easy as plopping in your shortcode, as well as just dropping in your Google Analytics code. Overall I feel leaving WP is more beneficial than staying with it.

Getting Hexo running is pretty straight forward, but actually deploying it to a server was a bit different, though fairly intuitive if you are already familiar with git. I won’t be going over the process as there are plenty of tutorials out there, but in short it is a NodeJS application that parses the MD you write and generates static files that can be deployed to really any webserver. It also has a simple configuration file for customizing the site. Hexo uses npm for installing plugins as they are just NodeJS apps that tie into Hexo. Themes are similarly easy to install, you find the one you like and clone the git repo into the themes/ directory.

Making a new post certainly involves more than it used to with WP, but it is pretty quick still, and all one needs to do is write a post in any text editor. The process is… - cd into the directory you have your blog - Issue hexo new "Post Title" - Open the newly generated file in your favorite text editor - Issue a hexo generate to render the Markdown to HTML - Check out the rendered HTML and make sure you’re happy with it - Lastly issue a hexo deploy to push it to your server!

The nice thing about the hexo deploy is it uses whatever deployment plugin you’ve installed, for example I’ve installed the plugin for deploying to a git repo. You pop in your credentials into your _config.yml (well the git target, branch, and make sure it is setup to accpt your ssh keys) and it creates a git repo out of the public/ directory and pushes it to the designated git repo. I’ve also setup some git hooks on the repo to have it then pull the code into the proper directory I am pointing my nginx server at. It is a lot more than just writing some stuff and hitting submit, but I feel it also lets me get a bit more freedom on what I use to edit the posts, as well as being able to write posts offline (not that big of a deal really) and I get to write in Markdown!

Anyway, Wordpress is dead to me, long live Hexo! At least until I get bored and try something else.

comments powered by Disqus