更多信息,请参考 Hexo+GithubPage搭建Fan主题的个人博客
更换主题
(1)打开 hexo主题网站,丛中找个自己喜欢的主题,比如这里选择 Fan主题
(2)打开Fan主题的github地址
(3)按照Fan的github地址中的安装指导进行安装
git clone https://github.com/fan-lv/Fan.git themes/Fan
如:
D:\src\blog_demo>git clone https://github.com/fan-lv/Fan.git themes/Fan
Cloning into 'themes/Fan'...
remote: Enumerating objects: 325, done.
remote: Counting objects: 100% (31/31), done.
remote: Compressing objects: 100% (12/12), done.
Rremote: Total 325 (delta 23), reused 19 (delta 19), pack-reused 294 : 87% (283/325), 2.18 MiB | 823.00 KiB/s
Receiving objects: 100% (325/325), 2.46 MiB | 854.00 KiB/s, done.
Resolving deltas: 100% (173/173), done.
D:\src\blog_demo>
(4)将_conffig.yml 中主题修改为Fan
(5)把如下文件中的两处enable修改为false
(6)如下配置文件中修改url好root,url即为建好后博客访问的地址,在步骤二中第(6)小步骤中可获得,root即为github上创建的项目名称,前后都需要加 /
(7)安装hexo-renderer-jade hexo-renderer-stylus
npm install --save hexo-renderer-jade hexo-renderer-stylus
如:
D:\src\blog_demo>npm install --save hexo-renderer-jade hexo-renderer-stylus
npm WARN deprecated hexo-renderer-jade@0.5.0: hexo-renderer-jade has been deprecated. Please install hexo-renderer-pug and rename all *.jade files to *.pug.
npm WARN deprecated constantinople@3.0.2: Please update to at least constantinople 3.1.1
npm WARN deprecated transformers@2.1.0: Deprecated, use jstransformer
npm WARN deprecated jade@1.11.0: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
added 86 packages, and audited 335 packages in 24s
20 packages are looking for funding
run `npm fund` for details
8 vulnerabilities (1 low, 1 moderate, 1 high, 5 critical)
To address issues that do not require attention, run:
npm audit fix
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
D:\src\blog_demo>
(8)再次在本地调试
hexo g
hexo s
如:
D:\src\blog_demo>hexo g
INFO Validating config
INFO Start processing
INFO Files loaded in 74 ms
(node:21912) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:21912) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:21912) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
(node:21912) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(node:21912) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:21912) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
INFO Generated: archives/index.html
INFO Generated: archives/2021/index.html
INFO Generated: index.html
INFO Generated: 2021/12/03/hello-world/index.html
INFO Generated: archives/2021/12/index.html
INFO Generated: favicon.ico
INFO Generated: css/thirdparty/fa-solid-900.woff
INFO Generated: images/avatar.png
INFO Generated: css/highlight/diff.css
INFO Generated: images/ufo.svg
INFO Generated: avatar.png
INFO Generated: images/top.svg
INFO Generated: css/min_screen_highlight/highlight.css
INFO Generated: css/min_screen_search/algolia.css
INFO Generated: js/search/algolia.js
INFO Generated: js/mathjax/mathjax.js
INFO Generated: css/min_screen_layout/footer.css
INFO Generated: js/comments/gitment.js
INFO Generated: js/thirdparty/jquery.mCustomScrollbar.concat.min.js
INFO Generated: css/highlight/theme.css
INFO Generated: css/min_screen_highlight/theme.css
INFO Generated: css/const.css
INFO Generated: js/sidebar.js
INFO Generated: js/fan.js
INFO Generated: js/canvas_bg.js
INFO Generated: js/copy.js
INFO Generated: js/utils.js
INFO Generated: css/highlight/highlight.css
INFO Generated: js/scroll.js
INFO Generated: css/min_screen_layout/header.css
INFO Generated: css/min_screen_layout/pagination.css
INFO Generated: css/min_screen_layout/page.css
INFO Generated: css/min_screen_layout/recent_posts.css
INFO Generated: css/min_screen_layout/post.css
INFO Generated: css/thirdparty/reset.css
INFO Generated: css/min_screen_search/index.css
INFO Generated: css/min_screen_layout/sidebar.css
INFO Generated: css/min_screen_layout/tag.css
INFO Generated: css/thirdparty/fontawesome.css
INFO Generated: js/thirdparty/velocity.min.js
INFO Generated: css/thirdparty/jquery.mCustomScrollbar.min.css
INFO Generated: css/fan.css
INFO Generated: js/thirdparty/jquery-3.3.1.min.js
INFO Generated: blog_demo.png
INFO 44 files generated in 853 ms
D:\src\blog_demo>hexo s
INFO Validating config
INFO Start processing
INFO Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
(9)浏览器打开 http://localhost:4000,如下表示已经配置OK