Setting up this Hexo blog is quite difficult. There are many unexpected problems that are solved and I will record them in this entry.
Install Node.js and Git
Install Hexo https://hexo.io/
Install Hexo Theme Journal https://github.com/SumiMakito/hexo-theme-journal/
Install Pandoc for LaTeX https://blog.csdn.net/qq_52466006/article/details/126924064
At this step, many problems occur. The major issue is the theme does not support LaTeX. I tried changing to
$npm install hexo-renderer-kramed
and$npm install hexo-renderer-mathjax
but it doesn't work. The reason is likely because that these two plugins are too old. On the otherhand,$npm install hexo-renderer-pandoc
is a safer choice because it needs less modifications and more robust.
From my research, this solution is more likely to work and should work for all themes on Hexo.
Write this in Powershell 1
2
3$npm un hexo-math
$npm un hexo-renderer-marked
$npm i hexo-renderer-pandoc
- Add the following to
_config.yml
in themes folder.
Here a problem that I encountered is that all $$ symbol in LaTeX is replaced by
\[
. The solution is to refer to a javascript in your HTML file. I triedhttp://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
but it does not work. This should be because this cdn is already down so a later one should be used instead.
1 | mathjax: |
Its also worth trying to add this:
1 |
in all MarkDown files that needs LaTeX.
Enter
pandoc -v
and see if Pandoc is successfully installed.Build the static website.
There are some general requirements for Hexo MarkDown files, such as no three slashes together, and the MarkDown files should be placed under
_posts
folder.
I added a profile page for my Blog. To do this, change the _config.yml in the themes folder and change the menu section. The format is
<Name>: <Path>
, for my Blog its About Me: /About.html.
Write this in Powershell
1 | $npx hexo generate |
- If successful, deploy the static website on Github Page! https://hexo.io/docs/one-command-deployment
Write this in Powershell
1 | $npm install hexo-deployer-git --save |
Change the _config.yml
in the root folder:
1 | deploy: |
And try
Here my connections was very unstable. The solution is to do git config
--global --unset http.proxy
then do git config--global --unset https.proxy
1 | $npx hexo deploy |
And my Hexo blog is successfully initialised on Github Page!