For nearly one year, I haven’t updated any new blog on my homepage. That’s because, the old Macbook where I deployed my hexo blog source code was not under frequently use. Now that my daily working laptop computer has switched to a new Windows 10 PC. To continue blogging on this new device, I spent sometime to sync the Mac old blogs and re-establish them on this new Windows machine. Here is a step by step brief summary of the whole processes. The re-establish of my blogs on the new windows machine mainly refers from the instruction on this page [https://zhuanlan.zhihu.com/p/26625249].

Install Git

The installation of Git on windows 10 has multiple benefits. First is the benefit for hexo blogging. Secondly, it will install a new bash terminal that can be open by right click menu in any folder. This greatly free me by hold shift key to call the window power shell. Git can be installed on windows by download the windows 64bit package from its official website [https://git-scm.com/downloads].

Install Nord.js

Similarly, Nord.js can also be installed from its official website [https://nodejs.org/en/]. However, in order to use let hexo working normally, one should use the old version of nord.js below version 14. Because the latest node.js version starting from version 14 has some compatibility problem with hexo, which could lead to deploy errors [https://github.com/hexojs/hexo-deployer-git/issues/177].

Install hexo

Installation of hexo can also be easily realized by these command, open the Git terminal and type:

1
npm install -g hexo-cli

Link to Github page

Once you installed hexo on windows 10, you can copy the old blogs to a new folder and set it as your new hexo blog main directory. Then your should sync your local blog with online Github homepage. This process is well described on the reference [https://zhuanlan.zhihu.com/p/26625249] page and will not be repeated here.

Local blog configurations

choose Chic theme

The hexo open source project offers various choices of blog themes, if you would like to spend that time and strength, you can even write your own blog themes. However, I do not have that much time to do this thing. After comparison of many themes, I found Chic theme [https://github.com/Siricee/hexo-theme-Chic] developed by LiuZijian could well fit all my requirement. Whose theme offers my favourite features such as:

  • simple and elegant blog page display without pictures that could cause load delay and distraction.
  • float content menu in each blog for easy jump and view
  • category and tags cloud for auto classification of all blog pages
  • one click button to switch between white and black modes

Here, I really wish to thanks for all the contributions from LiuZijian for providing such good theme in hexo open source project!

change page icon

After sometime, I finally located the default ico file location of hexo Chic theme. It is located at:

1
\hexo\themes\theme_Chic\source\favicon.ico

You can use this website [https://www.favicon-generator.org/] to online convert your favourite png/jpg image to .ico files [https://jdhao.github.io/2018/02/08/favicon-theme-next-setup/]. Then you just need to place your ico at this location and replace the old ico in the /theme/.config as:

1
2
3
# favicon
# favicon: /favicon_old5.ico
favicon: /ink_bamboo_1kB.ico

Then run the hexo clean, generate and server command, you can check whether the page ico change is switched.

enable category and tag cloud

To generate category and tag cloud in Chic them, you can follow the instruction on its official site. And to auto classify a blog page, you need to add new information in the header of a blog page such as this page:

1
2
3
4
5
6
---
title: hexo blog on windows10
tags: hexo
category: hexo
date: 2021-12-11 13:04:11
---

Local page debug

Once the local page source code is ready, you can render it on localhost:5000 for preview using these command:

1
2
3
hexo clean
hexo g
hexo s -p 5000

Deploy to GitHub homepage

Once the local page is debugged without errors, you can then deploy it online on Github page to share with the rest of the world with this command:

1
hexo d

Recover hexo

Some error occurs recently because I have synced the local blog source files on both Windows 10 and MacOS. Some files complied on MacOS does not work on the Windows 10, thus the Latex formula is not rendered correctly on Windows 10. The bug error report is like this:
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.
js 13.x

To solve this problem, I stop the syncing on the MacOS machine. Then I fixed the bug of render on Windows 10 following this instruction [https://stackoverflow.com/questions/37986800/node-sass-couldnt-find-a-binding-for-your-current-environment]. Which need to rebuild node-sass with the following command:

1
npm rebuild node-sass

However, after this operation, another error occur with the rendering of Latex formula. Because the original render hexo-katex under MacOS does not work on the Windows 10. To solve this problem, I following the instruction on this blog [https://blog.csdn.net/weixin_45073562/article/details/120289648], and switched the latex render from katex to Mathjax.

1
2
npm un hexo-renderer-marked
npm i hexo-renderer-pandoc

Then you need to manually edit the -config.yml file in hexo mother direction and change:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
markdown_it_plus:
highlight: true
html: true
xhtmlOut: true
breaks: true
langPrefix:
linkify: true
typographer:
quotes: “”‘’
plugins:
- plugin:
name: markdown-it-katex
enable: false
- plugin:
name: markdown-it-mark
enable: true

And change makedown-it-katex enable from true to false and markdone-it-mark from false to true. Then you also need to install the pandoc on your local Windows 10 machine from it official website [https://pandoc.org/installing.html].

After these steps, the Latex formula finally got correct display on the host website. However, sometimes the error in formula display may not caused by the software configuration but error in latex grammar.