Next主题升级记录

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
[root@localhost hexo]# pwd
/root/hexo

[root@localhost hexo]# hexo version
INFO Validating config
hexo: 7.3.0
hexo-cli: 4.3.2
os: linux 5.14.0-427.42.1.el9_4.x86_64 Rocky Linux 9.4 (Blue Onyx)
node: 18.20.4
acorn: 8.11.3
ada: 2.7.8
ares: 1.28.1
base64: 0.5.2
brotli: 1.0.9
cjs_module_lexer: 1.2.2
cldr: 44.1
icu: 74.2
llhttp: 6.1.1
modules: 108
napi: 9
nghttp2: 1.61.0
nghttp3: 0.7.0
ngtcp2: 1.3.0
openssl: 3.0.13+quic
simdutf: 5.2.4
tz: 2024a
undici: 5.28.4
unicode: 15.1
uv: 1.44.2
uvwasi: 0.0.19
v8: 10.2.154.26-node.37
zlib: 1.3.0.1-motley
[root@localhost hexo]#

next版本

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
37
38
39
40
41
[root@localhost next]# pwd
/root/hexo/themes/next

[root@localhost next]# cat package.json
{
"name": "hexo-theme-next",
"version": "7.8.0",
"description": "Elegant and powerful theme for Hexo.",
"main": "gulpfile.js",
"scripts": {
"test": "gulp"
},
"repository": {
"type": "git",
"url": "git+https://github.com/theme-next/hexo-theme-next.git"
},
"keywords": [
"hexo",
"theme",
"next"
],
"author": "NexT <support@theme-next.org> (https://theme-next.org)",
"license": "AGPL-3.0-or-later",
"bugs": {
"url": "https://github.com/theme-next/hexo-theme-next/issues"
},
"homepage": "https://theme-next.org",
"devDependencies": {
"eslint": "^6.8.0",
"eslint-config-theme-next": "^1.1.4",
"gulp": "^4.0.2",
"gulp-eslint": "^6.0.0",
"gulp-shell": "^0.8.0",
"js-yaml": "^3.13.1",
"stylint": "^2.0.0"
},
"engines": {
"node": ">=10.9.0"
}
}
[root@localhost next]#

主题更新

旧版更名

1
2
3
4
[root@localhost hexo]# pwd
/root/hexo

[root@localhost hexo]# mv themes/next themes/next-v7

更新新版

1
git clone https://github.com/next-theme/hexo-theme-next themes/next
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
[root@localhost next]# pwd
/root/hexo/themes/next

[root@localhost next]# ll
total 80
-rw-r--r--. 1 root root 29634 Jan 15 15:48 _config.yml
-rw-r--r--. 1 root root 232 Jan 15 15:27 crowdin.yml
drwxr-xr-x. 4 root root 82 Jan 15 15:27 docs
-rw-r--r--. 1 root root 79 Jan 15 15:27 eslint.config.js
drwxr-xr-x. 2 root root 4096 Jan 15 15:27 languages
drwxr-xr-x. 6 root root 4096 Jan 15 15:27 layout
-rw-r--r--. 1 root root 2955 Jan 15 15:27 LICENSE.md
-rw-r--r--. 1 root root 1148 Jan 15 15:27 package.json
-rw-r--r--. 1 root root 9484 Jan 15 15:27 README.md
-rw-r--r--. 1 root root 41 Jan 15 15:27 renovate.json
drwxr-xr-x. 6 root root 62 Jan 15 15:27 scripts
drwxr-xr-x. 5 root root 41 Jan 15 15:27 source
drwxr-xr-x. 5 root root 65 Jan 15 15:27 test
-rw-r--r--. 1 root root 4836 Jan 15 15:27 _vendors.yml
[root@localhost next]# cat package.json
{
"name": "hexo-theme-next",
"version": "8.22.0",
"description": "Elegant and powerful theme for Hexo.",
"main": "package.json",
"files": [
"docs",
"languages",
"layout",
"scripts",
"source",
"_config.yml",
"_vendors.yml"
],
"scripts": {
"eslint": "eslint scripts/ source/js test/",
"prepare": "node .githooks/install.js",
"stylint": "stylelint source/css/ --ip source/css/_common/scaffolding/highlight/index.styl",
"test": "mocha test/index.js",
"test-cov": "c8 npm test"
},
"repository": "next-theme/hexo-theme-next",
"keywords": [
"hexo",
"theme",
"next"
],
"author": "NexT (https://theme-next.js.org)",
"license": "AGPL-3.0-only",
"bugs": {
"url": "https://github.com/next-theme/hexo-theme-next/issues"
},
"homepage": "https://theme-next.js.org",
"devDependencies": {
"@next-theme/eslint-config": "0.0.4",
"c8": "10.1.3",
"chai": "4.5.0",
"eslint": "9.17.0",
"hexo": "7.3.0",
"hexo-renderer-marked": "6.3.0",
"js-yaml": "4.1.0",
"mocha": "11.0.1",
"stylelint": "16.12.0",
"stylelint-stylus": "1.0.0"
}
}
[root@localhost next]#

配置修改

主题配置修改

1
vi themes/next-v7/_config.yml (vi多视窗对照编辑  :sp themes/next/_config.yml)

开启mermaid

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
(站点配置文件_config.yml添加 - mermaid)

[root@localhost hexo]# pwd
/root/hexo

[root@localhost hexo]# vi _config.yml
highlight:
line_number: true
auto_detect: false
tab_replace: ''
wrap: true
hljs: false
exclude_languages:
- mermaid

(主题配置文件_config.yml开启mermaid)

[root@localhost next]# pwd
/root/hexo/themes/next

[root@localhost next]# vi _config.yml

mermaid:
enable: true

最后测试

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[root@localhost hexo]# hexo clean
INFO Validating config
INFO Deleted database.
[root@localhost hexo]# hexo s
INFO Validating config
INFO ==================================
███╗ ██╗███████╗██╗ ██╗████████╗
████╗ ██║██╔════╝╚██╗██╔╝╚══██╔══╝
██╔██╗ ██║█████╗ ╚███╔╝ ██║
██║╚██╗██║██╔══╝ ██╔██╗ ██║
██║ ╚████║███████╗██╔╝ ██╗ ██║

╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═╝
========================================

NexT version 8.22.0

Documentation: https://theme-next.js.org
========================================

INFO Start processing
INFO Hexo is running at http://localhost:4000/ . Press Ctrl+C to stop.

点击查看Mermaid效果