Personal Blog with Hexo
![](/uploads/icon.png)
This blog tracks how I setup my personal website using
Hexo
.
Env Initialization
The official documentation for Hexo
is here . To setup Hexo
env,
node.js
is needed. I isolated the dev env using miniconda .
git
is also required.
1 | conda create -n hexo -c conda-forge nodejs -y |
Setup
1 | hexo init <folder> |
Theme Redefine
I appreciate the simplicity of Hexo
theme Redefine
.
### Installation
Using
npm
1
2cd <folder>
npm install hexo-theme-redefine@latestIn
_config.yml
, set1
theme: redefine
Create
_config.redefine.yml
file in Hexo root directory. Copy everything from here into it.
Mathjax
For LaTex
rendering support. Installation guide here .
- Using
npm
1
npm install hexo-filter-mathjax
- Install hexo-renderer-pandoc
as renderer
1
2conda install -c conda-forge pandoc
npm install hexo-renderer-pandoc --save - Append configuration in
_config.yml
1
2
3
4
5
6
7mathjax:
tags: none # or 'ams' or 'all'
single_dollars: true # enable single dollar signs as in-line math delimiters
cjk_width: 0.9 # relative CJK char width
normal_width: 0.6 # relative normal (monospace) width
append_css: true # add CSS to every page
every_page: false # if true, every page will be rendered by mathjax regardless the `mathjax` setting in Front-matter of each article - Set
mathjax: true
in your article1
2
3
4
5
6
7
8
9
10---
title: MathJax Test
date: 2020-09-12 16:02:07
tags: MathJax
categories: MathJax
mathjax: true
---
$$
i\hbar\frac{\partial}{\partial t}\psi=-\frac{\hbar^2}{2m}\nabla^2\psi+V\psi
$$
Gitalk Comments
Follow the steps here .
- Create new
OAuth App
Homepage URL
andAuthorization callback URL
should all be your github pages url- Save
Client ID
andClient Secret
- Create a repo for
Gitalk
comments - Set
_config.redefine.yml
config file1
2
3
4
5
6
7
8
9
10
11comment:
# Whether to enable comment
enable: true
# Comment system
system: gitalk # waline, gitalk, twikoo
config:
gitalk:
clientID: <sample_1234567890abcdef1234>
clientSecret: <sample_1234567890abcdef1234567890abcdef12345678>
repo: <created_repo>
owner: <github_usrname>
Deployment
As documented here .
- Using
npm
1
npm install hexo-deployer-git --save
- Update
_config.yml
1
2
3
4deploy:
type: git
repo: git@github.com:<github_usrname>/<github_usrname>.github.io.git
branch: main
- Title: Personal Blog with Hexo
- Author: Jay Zhou
- Created at : 2023-06-14 17:04:22
- Updated at : 2023-06-30 01:07:14
- Link: https://ja1zhou.github.io/2023/06/14/Personal-Blog-with-Hexo/
- License: This work is licensed under CC BY-NC-SA 4.0.
Comments