Icarus 是一种非常简洁的 Hexo 主题,同时也安装了如评论和分享等很多可选的增强功能,使用起来非常方便好用。本篇文章主要介绍一下 Icarus 主题的配置基础。详细可以查看官方在线文档。
Icarus 页面介绍
Icarus 页面(包括可选控件和增强功能)主要包含以下部分:
- Top navigation bar
- Article display
- Sidebar widgets
- Comment, share and search plugin
- Bottom page footer
每一个部分都可以进行个性化处理,绝大多数的设置都放在了 _config.yml 文件里。
Icarus 基础配置
导航栏配置
Icarus 主题默认为英文模式,即使将博客的 language 更改为 zh-CN 导航栏的字还是英文。如果要更改为中文,则在如下位置进行更改(如将 Home 更改为首页):
1 | # Navigation bar link settings |
导航栏左边有一个 LOGO,也可以进行更改,将图片命名为 og_image.png 然后放到 source/images 文件夹中替换掉原图片。
另外,导航栏右边有一个 github 的图标,可以更改如下位置中 url 实现点击图标跳转到你的 github 仓库:
1 | # Navigation bar links to be shown on the right |
用户信息配置
用户信息在如下位置进行更改:
1 | - |
其中 follow 按钮可以链接到任何你想要的页面,如你的 github 首页。 social_links 也可以进行更改,如果想去掉则直接注释掉。
控件配置
控件的显示与否和显示位置在如下位置进行修改:
1 | widgets: |
每个小横杠下的内容表示一个控件,如果不想显示,可以直接注释掉,但要注意前面的横杠也要注释掉。另外,控件在文件中的顺序和在网页中的顺序是相同的。
文章配置
为文章添加一个 thumbnail
Icarus 文章可以选择是否添加一个 thumbnial,首先确认 _config.yml 文件里是否已允许 thumbnail 功能:
1 | artical: |
然后只需在文章顶部加上如下语句:
1 | --- |
为文章添加分类和标签
只需在文章顶部加上如下语句:
1 | --- |
应该注意的是 cat1 是 cat2 的父类。
页脚配置
从前面的导航栏和简介栏我们已经知道可以添加图标链接,页脚处也是如此,默认设置下页脚右侧为图标链接,格式如下:
1 | footer: |
Icarus 同样支持纯文字链接,格式如下:
1 | footer: |