Hello Hexo

Hello, Hexo!

I heard this deployment tool months ago and could not determine to use it until I met this fantastic theme, Phantom. Hexo is written by a Chinese (in Taiwan) and using nodejs rather than ruby. Due to the demographic dividend, there have been plenty of wonderful plugins born for Hexo. And truely it is more suitable to me than Jekyll (language support, themes, etc.). So I think it’s time to let me migrate to Hexo.

After following official guide of Hexo and author’s guide of Phantom, I successfully pushed my new site. A few problems I met as other people did.

Mathjax

The default engine of markdown in Hexo always transfer the meaning of underlines in formulars, like $$F_1(x)=F_2^2(x)$$, into Italic Format, which is unbelievably anoying.

I tried to use plugins like hexo-renderer-mathjax or hexo-math, but they failed to solve this problem.

Later I noticed that this is triggered by some reasons that are more fundamental. Decisively, I replace the default engine, hexo-renderer-marked, with hexo-renderer-pandoc. Pandoc is a powerful markdown engine that has been widely use in many areas and platforms. I’m not new to it. In R, I’ve use pandoc for years to create standard acedemic report.

One thing one must remember is to install the engine itself on the operating system, or you may met some error warnings pretty weird to solve. I’m on MacOS so I use Homebrew to do so, which is really smooth. Thank you Max.

The last part of driving mathjax is to load it. Add the following code into theme’s layout folder.

And add the following code too.

1
2
3
<% if (page.mathjax){ %>
<%- partial('mathjax') %>
<% } %>

I prefer this way to deploy MathJax rather than those plugins, because it is more convenient. We can master our option to open this function or not in order to speed up the loading time of one post.

Highlight

Phantom’s objective is concise so that the author get rid of those colorful syntax marks.

Let’s be hornest, I’m always confused by those kinds of highlighting javascripts. What’s their difference?

I tried Prism, Prettify. They do not satisfy me. Actually all I want is just a Tomorrow-Eighies’ theme.

Later I find this style in the folder of highlight.js, which is a default by Hexo.

Unfortunately Phantom seems using its own code and I failed to replace so I give up now.

Github History

The previous on github has been kept committing for years. A new deployment execution in Hexo can remove them all.

I figured out the solution.

Copy previous blog repo directory into this hexo as a name of .deploy_git, and execute hexo clean; hexo d -g and everthing would be fine.

Disqus comments

I’m deeply sorry for the lost of my visitor’s comments. Disqus cannot automatically just migrate comments but it support manually submit. I’ve done my part and waiting for its reply.

Reference

0%