从WordPress迁移到hexo啦!
自定义css样式
修改博客根目录下的source/_data/styles.styl文件,增加网格背景:
1 | body { |
next 主题
增加阅读进度条
修改主题配置文件_config.yml:
1 | # Reading progress bar |
开启版权声明
新版的next和老版开启声明不一样,对着网上许多教程做发现大部分都是过时的,在此记录一下。
更改themes下的主题配置文件_config.yml:
1 | links: |
记得改hexo的配置文件_config.yml:
1 | # URL |
启用mermaid
参考[1]
常用命令
1 | 不要用anaconda自带的pandoc |
增加kindle页
使用muzi502/kindle项目生成网页
该项目的运行命令如下: 1
2
3python3 kindle.py
github_poster json --json_file date.json --year 2021 --me kindleReading --background-color '#222222'
mv OUT_FOLDER/json.svg date.svgstyle/css/custom.css的返回键按钮,末尾增加以下内容:
1
2
3
4
5
6
7.go-back{
position:fixed;
right:2vw;
bottom:3vh;
z-index:5;
border-radius:50%
}kindle文件夹,并将上边项目的以下文件拷贝到其中:style,books,index.html,date.svg.
最后修改hexo根目录下的themes/next/_config.yaml,新增kindle一行:
1
2
3
4
5
6
7
8
9
10menu:
home: / || home
#about: /about/ || user
#tags: /tags/ || tags
#categories: /categories/ || th
archives: /archives/ || archive
#schedule: /schedule/ || calendar
#sitemap: /sitemap.xml || sitemap
#commonweal: /404/ || heartbeat
kindle: /kindle/ || bookthemes/next/languages/default.yml配置:
1
2
3
4
5
6
7
8
9
10
11menu:
home: Home
archives: Archives
categories: Categories
tags: Tags
about: About
search: Search
schedule: Schedule
sitemap: Sitemap
commonweal: Commonweal 404
kindle: Kindle
换开发环境,迁移到WSL
从之前的mac环境,迁移到WSL里,需要重新安装以下hexo环境 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37sudo apt update && sudo apt upgrade -y
sudo apt install -y git curl wget build-essential
安装 Node.js 和 npm
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install -y nodejs
安装 Hexo CLI, 可以通过@4.3.1指定版本
sudo npm install -g hexo-cli@4.3.1
项目本身已存在,需要cd 到你的项目目录,该目录有下面这些目录
_config.yml node_modules/ package.json scaffolds/ source/ themes/
在该目录执行
npm install
遇到了highlight.js 9.18.5 版本停止维护的问题
npm install highlight.js@10.7.2 --save
npm list highlight.js # 运行后发现还有9.8.15
npm audit fix --force # 强行纠正
hexo clean
hexo generate
hexo server
hexo deploy
安装github_poster
pip3 install -U 'github_poster[all]'
Reference
[1] https://alltobenice.gitee.io/2021/03/06/BlogOpt/NexT%E4%B8%BB%E9%A2%98%E4%BC%98%E5%8C%96/