From Jekyll to Hexo

The idea of having a blog has been in my mind for a long time.

In fact, I had a blog prior to this one, which was built on top of Jekyll. To be honest, I have tried Ruby many times, but have never felt like it was something for me, or maybe I haven't really spent enough time to discover what it has to offer.

Either way, I find Ruby and Jekyll to be a little annoying to install and mantain, which is why my old blog was left unmantained.

In this blog post I'll describe some of the features I search for, and why I chose Hexo.

What I'm looking for

As I said before, I'm not much of a Ruby guy, I spend my days writing Javascript and Python for the most part. I've lately become very familiar with the workflow of these programming languages and their tools.

I'm also a heavy Emacs user, and thus I prefer to use org-mode for writing documents and whatnot. It is by far better than markdown, I'm really used to it and the fact that it can be parsed and exported makes it a very versatile markup language for emacs users.

So, in the end, what I wanted was a blogging system that allowed me to write my posts in org mode, preferably not having to export it to anything, and I wanted this system to just work.

Needless to say, Jekyll was not it.

Problems

I will say once again that I'm not a Ruby guy.

I'll just list the problems:

  1. After every Ruby update, gems had to be reinstalled, because the path to gems got broken.
  2. I had to either write markdown or export an org file to Jekyll, save it and rename it.
  3. I had to manually set the date in the file name for every post.

My problem was mostly with the second point, because I believe that having to mantain two copies of files is a little moronic, to say the least.

The paradigm shift

This past week, Mike Zamansky released a blog post and video on how he blogs, explaining why he moved away from Jekyll to Nikola and it made so much sense to me, because i was having the same problems with it.

At the same time, on one project I'm working on, we decided to move some code away from jQuery to AngularJS, and to manage our dependencies with yarn. To be honest, I've never been prone to change, but this change to AngularJS made me think about how the Front-End community is gravitating toward Javascript and RESTful services. I hear there's even backend servers for Node.JS.

So, in short: The Web development community is gravitating towards javascript (at least in this era) and we should use the tools we feel the most comfortable with.

And so I thought: yeah, let's ditch Jekyll and let's build something on top of Javascript.

I have to say I am very comfortable with Python as well, but I feel like I should really get into the Javascript world.

That's when i discovered Hexo. A quick search in Google led me to StaticGen, which pointed me to Hexo.

Moving to Hexo

Hexo is a static site generator built on top of Javascript that provides every feature I ever desired for a static site generator, and more.

With it I can:

  • Write every post with org mode and just be done with it.
  • Deploy to github effortlessly.
  • Manage it from Emacs.
  • Learn some Javascript.

And, of course it doesn't break.

I'll shortly describe what I've added to Hexo to make it work with Emacs and org-mode.

Emacs workflow

I'm sure someone else can explain better how to install Hexo, so I won't go over that. Instead, I'll describe how to set up org mode and Emacs to work with this awesome static site generator

I installed the org mode parser:

yarn add hexo-renderer-org

Which lets me write every post with org-mode and Hexo will properly generate the site without me having to export my org mode files.

And, the one I believe is the killer, is hexo.el, an extension for Emacs which allows me to manage all of my Hexo site from within Emacs. Hell, I don't even need a shell for this now.

Conclusion

While I think I still have some time to get used to this, Hexo looks very promising as a static site generator for Emacs users. The worflow features a very rich management environment provided by hexo.el and a very solid org mode parser which allows its user to write posts using Emacs org-mode.

Configuring an Asus Zenbook with Arch Linux

I recently got my hands on a brand new Asus Zenbook UX303 and it looks quite nice. So I did the first thing I wanted to do with it right away: Install Arch Linux. Yeah, I've been using Arch for quite a bit now on my desktop PC and I fell in love with it from the very first time I used it. No PPA nonsense, easy development and, to be honest, I'm quite used to its workflow.

Since the laptop came bundled with Windows, there was some work to do. I downloaded Arch Linux, made a bootable USB Flash Drive using Rufus and started with the installation right away. The guide can be found on the Arch Wiki.

UEFI on Arch

The process is quite straightforward if you read carefully. I got kind of stuck at this because, well, I like to do the process fast, but it can't always be like that. Do not forget to use gdisk for GPT partitions.

Also, some little but useful pointers:

  • The boot partition has to be EFI System Partition, which has code EF00.
  • This partition also has to be set to FAT32.

The rest is easy, just follow the guide. Nothing out of the ordinary. I'm sure people explain this better on youtube.

GNOME

I've been using GNOME for quite some time and I'm quite happy with it. There are some critical extensions that have to be installed to make it usable but that's ok. I'll write about it some other time.

Anyway, not everything works out of the box here, most of it is on the ArchWiki. I'll explain what i went through.

WiFi

WiFi is quite a pain to configure without a GUI. You need sudo and it gets kind of annoying. Just install NetworkManager, set it up (in GNOME gets as easy as just starting a service) and be done with it.

Bluetooth

Same thing here. Just follow the wiki, install the packages, enable the service. Done.

You might want to get this right in order to share Internet Connection with your cellphone. I have a Galaxy A5 2016 and it works flawlessly.

The rest

I had no problems with anything else. The rest of the stuff should work out of the box.

Hardware

This is the point where things get tricky. It took me quite a while to figure these issues out, and thats what made me want to do this post.

Keyboard.

I'm quite fond of the keyboard in this model though it could be nicer to have media keys. While the keyboard in this model has a lot of keys, I only find important to be able to control screen brightness, keyboard backlight and volume. I haven't really tested anything else.

The Keyboard brightness and Volume keys worked right out of the box for me, as did the disable touchpad button. Unfortunately, i can't say the same thing about the brightness keys, as they do not work out of the box. It's not so bad though, because GNOME's user panel can control the screen backlight, which provides an usable workaround.

I did a little research and it turned out my ACPI was working, it was just that the OS couldn't handle the keys. Long story short, adding these options to my kernel made my backlight keys work:

acpi_osi= acpi_backlight=none

With systemd-boot, you have to append the text to the options line. In my case, it was the file /boot/loader/entries/arch.conf. acpi_osi= makes the keys work but they don't do anything, and acpi_backlight=none rebinds everything to the backlight_intel interface.

GPU

GPU is probably the most tricky feature to set up in this model.

The ArchWiki has an article on how to set up Bumblebee in order to get the best of both worlds: Integrated graphics and dedicated video card. I must say I gave it endless tries to get it working and it -to some extent- does work. But only until i close the laptop. It then becomes unusable.

I still have problems with this, so i won't be advising on this matter. I will say, though, that gaming on a 14 inch laptop is not really the best setup. I still have my desktop for that.

Battery discharging

I found out some months after I wrote this post, that nothing gets restored after the battery dies.

Honestly I don't really want to test this feature, because bad things can happen: my battery can reduce its life or I might not get it to work on the first time. I can live with it, though, because the battery duration is quite good.

Conclusion

After months of using this laptop I have to say it is one of the smoothest computers I've ever used, it rarely freezes and it doesnt really overheat. Trying Linux on this laptop is definetly worth a try. I've been using it for around 9 months now and have barely had any problems