Why I Switched from Wordpress to Hexo - Part 2

In my last post I talked about the reasons that I’ve decided to move away from Wordpress toward a static site generator called Hexo. In this post I’m going to go into some detail about how Hexo works and discuss some pros and cons.

In a nutshell, Hexo uses NodeJS to convert a number of configuration files, template files, and content files (written in markdown) into a static HTML website. If you’re interested in getting started you can find information in the Hexo documentation.


Because there is no database or admin panel like there is in other content management systems, working with Hexo really requires the use of a source control tool like git. Once you get all of your files into git your workflow is very straight forward. You can create a new post with a simple command:

$ hexo new my-post-title

This creates a new markdown file in the source/_posts folder. Simply open this file in your favorite text editor and get writing. You can add a title, tags, and categories at the top of the file. When you’re ready to see what your post looks like on the site you can run it locally with the command:

$ hexo server

This will spin up a local web server at localhost:4000 where you can view your site in real-time. Once your post is up to snuff, you can run the hexo generate command:

$ hexo generate

This will create your HTML website. It’s then a simple matter of publishing the generated site to your webserver. There are built-in deployment commands that can publish your site automatically but I’ve had mixed results trying to deploy in this way.


One area that I haven’t spent too much time playing around with yet is themes. There are a number of themes available for download on the Hexo themes page but I have yet to dive into creating my own theme as of yet. There’s a good chance that I will do that in the future and I’ll be sure to post about the process.

Hexo Pros

  • No database or server-side code to deal with!
  • The resulting site is very light-weight and blazing fast (remember, there are no server-side calls or database table look-ups, just raw HTML)
  • The entire site can be managed within a text editor
  • No security concerns
  • No updates that can break your site

Hexo Cons

  • No wysiwyg editor for managing content (although there are plugins that provide this functionality)
  • Requires more technical know-how in order to manage your site
  • Dependency on Disqus for comments
  • Built-in deployment is hit or miss

Why I Switched from Wordpress to Hexo - Part 1

We’ve been working with Wordpress a lot lately over at Solar Sail. A lot of our clients are interested in implementing a content management system to make it easier for them to update the content on their websites. Over the years Wordpress has become the big man on campus in the world of content management systems so it is often requested by name. The problem is that our clients don’t tend to have huge budgets that allow us to bring in a designer to create a custom design for them. Instead, what we tend to do is go out and find a free or inexpensive theme that they like and then “tweak” it for our needs. Often, these themes are purchaed from a theme shop such as Theme Forest. And, although they always look nice on the surface they tend to be absolute nightmares to work with. These theme developers go out of their way to make things as difficult as possible to modify. I don’t know how many times I’ve been trying to do something as simple as change the background color of a div so I take a look at the source code and see this:

<div style="background-color: #FFF !Important;">Awesome Content!</div>

So much for modifying the CSS…and of course this HTML is nowhere to be found in any template file. No, no, it’s being generated by Wordpress so it’s time to start wading through what can be literally hundreds of php functions trying to find the one that creates this code. It’s just a horrible experience.

This isn’t my only problem with Wordpress. It has gotten seriously bloated over the years. The wordpress core files along with a theme and a handful of plugins can easily be thousands of files and be gigabytes in size. Not to mention the MySQL database that needs to go along for the ride. Now, if you’re managing a large site and you’re using WooCommerce or somethign similar for ecommerce on your Wordpress site than maybe all of this is necessary. But, if you’re running a blog or small-scale site do you really need to be managing all of those files. Not only that, but Wordpress is constantly needing to be updated to account for all of the security vulnerabilites.

A Different Approach

So, what are the alternatives? Are other content management systems better? Joomla! maybe? Or Drupal? No, these platforms all suffer from the same problems in my opinion. I really started to think that maybe the best thing to do is just manage static HTML files in a source control system. I mean, I know HTML, it would be no problem for me to edit posts and pages directly as opposed to the wysiwyg editor that comes with Wordpress. But there are problems with this approach of course. First of all, Wordpress provides a lot of functionality that you may take for granted such as categories, tagging, comments, archives, and friendly URLs. Although the HTML files themselves would not be hard for me to manage, this other stuff would be very difficult.

In Steps Hexo

I began doing some research and came across the concept of a static site generator. This was something new to me but as I read more I realized how much sense it makes! Without server-side code and databases you are virtually eliminating security vulnerabilites. Not to mention the fact that you are streamlining your entire development and maintenance workflows down to editing a bunch of text files. After dealing with Wordpress and all the complexities that come along with it, the idea of going back to basics really intrigued me. So, I did some research and came across staticgen.com. This site lists all of the most popular site generators available today. I took a look at a few of them and finally settled on Hexo because it was blog-focused and a blog is exactly what I was looking to build.

In the next post I’ll go over how Hexo works and talk about some of its pros and cons.

Next: Working with Hexo

Book Review: Off To Be The Wizard

In Off To Be The Wizard author Scott Meyer tells the story of Martin, a regular guy living a regular life who discovers a hidden file on the Internet that controls the entire world. A simple edit to the file can teleport Martin to new locations, send him back in time, or even fill his bank account. This last one gets Martin in a little bit of hot water with the authorities so he decides that the obvious solution is to go back to medieval England and become a wizard. Little does Martin know that not only is he not the first person to find this file but he’s also not the only one to think it might be a good idea to go back in time in order to use the files powers to be the next Merlin. Martin soon meets a wide variety of colorful characters who ultimately need to team up to defeat a Rouge wizard who is using the file to violate the natural order of things.

Despite the very far-fetched plot line, I found Off To Be The Wizard to be a very entertaining read. The story is fast paced with just enough action and humor to keep you turning pages. The humor in the book leans heavily on geek culture and the book is clearly geared towards readers who are self-described “geeks.” Meyer uses a lot of computer vernacular when describing how the wizards interact with the file that may be a turn-off to anyone who isn’t very computer literate.

On the character front, Off To Be The Wizard is really dominated by the the wizards themselves and their interactions with each other. There is really only one or two scenes in which the wizards have any lengthy interaction with the common folk of medieval England. This doesn’t really pose a problem since much of the story revolves around Martin coming to grips with his new found power and the community of wizards he is trying to become a part of. I’m interested to see if Meyer takes the story in a different direction in the second book of the series.

Off To Be The Wizard is not without its flaws. As I mentioned before, the plot line is very far-fetched. There is only a brief discussion of the implications of time-travel. The changes that the characters make in the past have no effect on their future. However, they really don’t get into how the changes will impact some other future. Meyer is hoping you don’t spend too much time thinking about the paradoxes that his world produces. There is also the matter of how all these wizards end up going back to the exact same time in history. This is discussed briefly but seems like another area where the author is just hoping you suspend your disbelief.

In conclusion, if you are a self-described geek who enjoys computers, time travel paradoxes, and fantasy then I think you’re going to enjoy the first novel in Scott Meyer’s Wizard 2.0 series. If you find any of these things boring you may want to stay away.

3.5/5 stars

Buy Off To Be The Wizard from Amazon