1.配置Hexo基本信息
1 | title: 猫熊小才天の书院 #博客标题 |
2.更换主题Next
2.1 安装主题
输入以下指令
1 | git clone https://github.com/iissnan/hexo-theme-next themes/next |
下载完成后,修改根目录下_config.yml文件的theme字段为next即可启用NexT主题
1 | # Extensions |
2.2 配置主题
在footer部分,可以将powered和theme全部只为false,就可以屏蔽掉尾注
menu部分只打开home、tags、categories、archives即可
scheme按照喜好选择
将enable置为true,避免首页一次显示文章全部
1 | auto_excerpt: |
3.添加分类和标签功能
进入到博客根目录,输入以下命令
1 | hexo new page categories |
成功后会提示:
1 | INFO Created: ~/Documents/blog/source/categories/index.md |
根据上面的路径,找到index.md这个文件,打开后默认内容是这样的:
1 | --- |
添加type: “categories”到内容中,添加后文件如下:
1 | --- |
同理,如上操作创建标签功能
1 | $ hexo new page tags |
1 | --- |
给文章添加分类和标签的样式如下:
1 | --- |
可以打开scaffolds/post.md文件,在tages:上面加入categories:
1 | --- |
保存后,之后执行hexo new 文章名命令生成的文件会自动加上categories