Hexo博客更换主题

在文章Hexo搭建个人博客中我们介绍了如何利用Hexo搭建个人博客,刚搭建默认的主题是landscape,我们也可以更换自己喜欢的主题,这里以更换NexT主题为例

NexT主题GitHub首页:https://github.com/theme-next/hexo-theme-next

安装主题

首先进入博客项目根目录

d:\>cd hexo/blog

d:\hexo\blog>

然后安装NexT主题

命令:git clone https://github.com/theme-next/hexo-theme-next themes/next

D:\hexo\blog>git clone https://github.com/theme-next/hexo-theme-next themes/next
Cloning into 'themes/next'...
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 7195 (delta 0), reused 1 (delta 0), pack-reused 7187
Receiving objects: 100% (7195/7195), 5.57 MiB | 652.00 KiB/s, done.
Resolving deltas: 100% (4640/4640), done.

主题下载成功后存放在如下目录:博客根目录/themes目录下

配置主题

在项目根目录下打开_config.yml文件,找到theme属性,改成

theme: next

重启服务

重启服务后即可生效

D:\hexo\blog>hexo g
INFO  Start processing
INFO  Files loaded in 883 ms
INFO  Generated: archives/2019/index.html
INFO  Generated: 2019/06/16/hello-world/index.html
INFO  Generated: archives/index.html
INFO  Generated: archives/2019/06/index.html
INFO  Generated: index.html
INFO  5 files generated in 731 ms

D:\hexo\blog>hexo s
INFO  Start processing
INFO  Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.

更新NexT

首先进入NexT主题所在路径

D:\>cd D:/hexo/blog/themes/next

然后执行命令:git pull

D:\hexo\blog\themes\next>git pull
Already up to date.

 

posted @ 2019-06-16 23:01  野猿新一  阅读(35)  评论(0)    收藏  举报