hexo 主题使用
更换为next主题
进入hexo站点文件夹
1 | cd your-hexo-site |
clone Next代码并存放到 themes/next 目录下(用目前比较火的next主题为例)
1 | git clone https://github.com/iissnan/hexo-theme-next themes/next |
在站点 _config.yml 中修改:
1 | theme: next |
Next 主题拥有”题中题”,可以在主题的 _config.yml 中设置:
1 | scheme: Mist # 开启Next.Mist主题 |
设置头像
在站点 _config.yml 中添加
1 | avatar: http://.... # 头像的URL |
添加分类
新建一个页面,命名为 categories
1 | hexo new page categories |
在 source/categories 目录的 index.md 中修改:
1 | title: 分类 |
在主题的 _config.yml 中取消注释:
1 | categories: /categories |
在要分类的文章中加入 category 属性:
1 | category: "hexo" # 分类为 hexo |
添加标签
新建一个页面,命名为 tags
1 | hexo new page tags |
在 source/tags 目录的 index.md 中修改:
1 | title: tags |
在主题的 _config.yml 中取消注释:
1 | tags: /tags |
在需要变迁的文章中加入 tgs 属性:
1 | tags: [spark,sparkSQL] # 添加spark和sparkSQL两个标签 |
添加评论
在 多说 创建一个站点,创建时填写的多说域名就是你的 duoshuo_shortname
在站点 _config.yml 中设置:
1 | duoshuo_shortname: your_duoshuo_shortname |
更多功能
参考 next官方帮助文档