Uncategorized

Migrating from Jekyll to Hexo

WesternDevs has a shiny new look thanks to graphic designer extraodinaire, Karen Chudobiak. When implementing the design, we also decided to switch from Jekyll to Hexo. Besides having the opportunity to learn NodeJS, the other main reason was Windows. Most of us use it as our primary machine and Jekyll doesn’t officially buoy it. There are instructions accessible by people who were obviously more successful at it than we were. And there are even simpler ones that I discovered during the course of writing this post and that I please existed three months ago.

Regardless, now we are and it’s already been a positive move overall , not least because the move to Node necessitates more of us are available to help with the maintenance of the website. But it wasn’t without it’s challenges. So I’m going to outline the major ones we faced here in the hopes that it will help you impel your decision well informed than ours was.

To preface this , note that I’m brand-new to Node and in fact, this is my first real activity with it. That said, I’m no professional in Ruby either, which is what Jekyll is written in. And the short-lived version of my first impressions is: Jekyll feels more like a real product but I had an easier period customizing Hexo once I dug into it. Here’s the longer version

DOCUMENTATION/RESOURCES

You’ll run into this very quickly. Documentation for Hexo is respectable but incomplete. And formerly you start Googling, you’ll discover many of the resources are in Chinese. I find very quickly that there isposts collection and that each affix has a lists collect. But as to what these objects look like, I couldn’t tell. They aren’t arrays. And you can’t JSON.stringify them because they have circular cites in their own homes. util.inspect designs but it’s not available everywhere.

MULTI-AUTHOR Aid

By default, Hexo doesn’t support multiple authors. Neither does Jekyll, mind you, but we felt apretty ended theme that does. In Hexo, there’s a decent package that does you partway there. It lets you specify an generator ID on a post and it will fasten a knot of information to it. But you can’t, for example, get a full list of generators to roll on a Who We Are page. So we created a separate data file for the authors. But we also haven’t figured out how to use that record to generate a. json file to use for the Featured section on the home page. So at the moment, we have author information in three targets. Our temporary mixture is to disallow anyone from joining or leaving Western Devs.

CUSTOMIZATION

If you go with Hexo and pick an existing themes, you won’t run into the same questions we did. Out of the box, it has good support for posts, lists, pagination, even things like calls and aliases with the right plugins.

But we started from a scheme and were migrating from an existing site with existing URLs and had to make it work. I’ve mentioned the challenge of multiple scribes previously. Another one: maintaining our URLs. Most of our poles aren’t categorized. In Jekyll, that means they show up at the root of the locate. In Hexo, that’s not possible. At least at the moment and I believe this is a bug. We eventually had to fork Hexo itself to maintain our existing URLs.

Another challenge: excerpts. In Jekyll, excerpts design like this: Check the front matter for an excerpt. If one doesn’t exist, make the first few courages from the pole. In Hexo, excerpts are empty-bellied by default. If you compute a label in your berth, everything before that is considered an excerpt. If you specify an excerpt in your front matter, it’s dismissed because there is already an excerptproperty on your posts.

Luckily, there’s a plugin to address the last point. But it was better didn’t regarding the issue of all our affixes without an excerpt which is something we relied solely on the contents of the post.

So if you’re looking to veer from the written road, are drawn up. More on this later in the” good roles” section.

OVERALL FEELING OF RAWNESS

This is more a consummation of the previous problems. It precisely feels like Hexo is a work-in-progress whereas Jekyll feels more like a finished product. There’s a strong community behind Jekyll and abundance of assistant. Hexo still has defects that suggest it’s just not employed much in the wildernes. Like rendering headers with associations in their own homes. It sees the learning process a bit challenging because with Jekyll, if something didn’t work, I’d mull I’m plainly doing something wrong. With Hexo, it’s I might be doing something wrong or there might be a bug.

THE GOOD PARTS

I said earlier that the move to Hexo was positive overall and not just because I’m idealistic by nature. There was still two key interests we’ve gained time in the last two weeks.

Generation Meter

Hexo is fast, plain and simple. Our old-fashioned Jekyll site took six seconds to generate. Doesn’t sound like much but when you’re working on a feature or nipping a pole, then saving, then refreshing, then cleaning, then recurring, that six seconds adds up fast. In Hexo, a full locate generation makes three seconds. But most importantly, it is smart enough to do incremental revises while you’re working on it. So if you run hexo server, then identify a mistake in your pole, you can save it, and the conversion will be taken into consideration nearly instantly. In information, it’s usually done by the time I’ve swapped back to the browser.

Backer

We had logistical challenges with Jekyll. To the pitch where we had two methods for Windows useds that wanted to contribute( i.e. contribute a affix ). One involved a Docker image and the other Azure ARM. Neither was ideal as they took between seconds and times to refresh if you moved changes. Granted, both methods furthered our collective knowledge in both Docker and Azure but they both kinda sucked for productivity.

That means that realistically, exclusively the Mac consumers genuinely contributed to the maintenance of the area. And our Docker/ Azure ARM handles were largely neglected as we would generally merely experiment in make. I.e. create a post, check it in, wait for the site to deploy, make necessary mutates, etc, etc.

With the switch to Hexo, we’ve had no fewer than five helps to the site’s maintenance previously. Hexo merely works on Windows. And on Mac. Best of both worlds.

CUSTOMIZATION

This is listed under the challenges but ever the optimist, I’m including it here as well. We’ve had to acquire some customizations for our site, including forking Hexo itself. And for me personally, once I went past the why isn’t this working the behavior I require? stage, it’s been a ton of entertaining. It’s crazy simple to muck around in the node modules to try stuff out. And just as simple to fork something and invoke it in your job when the need originates. I mentioned an earlier question making relations in headers. No question, we just swapped out the markdown renderer for another one. And if that doesn’t work, we’ll nip something until it does.

I want to talk more on specific conversion issues we ran into as a template to those following in our footsteps. But there are enough of them to warrant a follow up post without all this pre-amble. For now, we’re all feeling the passion for Hexo. So much so that no less than three other Western Devs are in the process of converting their personal blogs to it.

Primarily announced to: http :// www.westerndevs.com/ jekyll/ hexo/ Migrating-from-Jekyll-to-Hexo /

Read more: feedproxy.google.com