A fresh face

If you’ve been a reader of this site, you’ve noticed the facelift of the site after many years of running the same theme. This is more than just a new theme, there is also a new back end powering the site. The previous site was running on Wordpress much like millions of other sites out there on the web. I’m going to use this post to talk about the reasons for the changes and the new way that I’m now writing and publishing articles.

New Site Goals

  • Have a way to write in markdown
  • Make it fast
  • cut out the cruft
  • Version control
  • Automation.

New Hotness

I did a little digging around to scratch my first goal off which was to get a markdown editor in the mix somehow. I’m sure there are plugins out there to do this in wordpress, but I was also trying to solve goal number 2 and make the site as lean and mean as I could. While digging into this, I ran across a site running off Hugo. I hadn’t heard of it but I liked the theme they were running. Looking into it further, it looked promising from the beginning. Markdown supported, nice theme and generated a static site on the backend which should be a lot faster than what I’m running now. By moving to Hugo, I would also cut out a lot of the overhead of Wordpress that I honestly just didn’t need.

Making the move

One of the big questions I had was to just leave all the old content behind or to try and export it to the new formatting. Luckily there is a plugin for that. By using the exporter, found here, i was able to download all the content that I had in the previous site. The conversion couldn’t have been easier. First install the plugin. Then run it either from the command line or from the UI. I chose the command line which gave me a zip file in the /tmp directly. From there I copied the zip file into my hugo content folder, ran hugo and just like freaking magic, it worked! I now have all the old content ready to be served up. Sure there is some cruft in some of the image paths listing out certain wordpress paths, but over all, HUGE win and for the most part, everything just works.

How I write articles.

Now that I no longer have a WYSIWYG editor, I can finally go back to using just VIM to write my articles. Doing it on the command line the way our fathers and grandfathers did it dammit! To write a new article, its simply a command of hugo new post/<namehere>.md that will put in some of the plumbing headers that you will want to have in there. Open up the file in your favorite editor and start writing. Once you are good to go, you can do various tests by running the site with hugo. I do it by running hugo server and then I have it configured to watch certain directories for changes and rebuild the site if needed. I get the latest content in real time. When I’m ready to deploy my article, I’m simply commiting the code into my local git repository. From there, puppet takes over. Using the VCSrepo module, I have my site checked out to the server in under 30 minutes. Here is the code that I’m using in my nodes.pp file.

vcsrepo { '<webpath_here>':
	ensure  => latest,
	provider=> git,
	source  => 'ssh://<username>@<servername>/<gitpath>/usrlocal.git',
	user    => 'usrlocal.com',
	revision=> master,
	path    => '<webpath_here';

And that’s pretty much it. This has pretty much solved all the issues that I had with the previous setup. Is it for everyone? Definitely not. I wouldn’t have my wife run her blog this way. But for the programmer in me that is pushing code on several side projects as it is. This feels really natural for me to write and publish my posts. So far, I really like it. We’ll see how long I keep this new system around.

Matt Patterson avatar
About Matt Patterson
Husband, Father of 3, Programmer at heart, spends his days running ridiculously large data centers in the midwest.