当我们安装完Hexo后,系统默认为我们设置了landscape主题,其实这款主题还是不错的,很简洁 。但是如何更换主题呢?接下来就为大家带来 Hexo更换主题 的教程。

Step 1:下载主题

1.点击Hexo主题中心,找到适合自己的主题。

2.点击主题名称,进入github仓库

3.下载主题

下载方式有两种

  1. git clone 命令下载
  2. 直接下载压缩包

新手推荐下载压缩包

Step 2:修改主题

下载完成后,解压文件,把主题文件重命名为theme(名字是随意的,可以不重命名,但是一般默认名称比较长,后面填主题名称不方便)。

把这个文件放到 博客根目录/themes/ 下面 ,例如:

pic064fb41.png

然后在博客根目录下 找到 _config.yml 这个配置文件并打开,找到:

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: landscape

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: 
    github: https://github.com/yremp/yremp.github.io.git
    coding: git@git.dev.tencent.com:yremp/yremp.coding.me.git
  branch: master

将theme: landscape 修改为 theme: theme (注意冒号后面必须有一个空格) ,修改后如下:

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: theme

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: 
    github: https://github.com/yremp/yremp.github.io.git
    coding: git@git.dev.tencent.com:yremp/yremp.coding.me.git
  branch: master

然后依次执行:

hexo clean //这个命令一般在修改配置文件后才需要执行
hexo g
hexo d

就可以看到更换后的主题了

Hexo 更换主题

标签云

ajax AOP Bootstrap cdn Chevereto CSS Docker Editormd GC Github Hexo IDEA JavaScript jsDeliver JS樱花特效 JVM Linux Live2D markdown Maven MyBatis MyBatis-plus MySQL Navicat Oracle Pictures QQ Sakura SEO Spring Boot Spring Cloud Spring Cloud Alibaba SpringMVC Thymeleaf Vue Web WebSocket Wechat Social WordPress Yoast SEO 代理 分页 图床 小幸运 通信原理

Hexo更换主题
Hexo更换主题