hexo-theme-matery
Front-matter 选项详解
Front-matter 选项中的所有内容均为非必填的。但我仍然建议至少填写 title 和 date 的值。
| 配置选项 | 默认值 | 描述 |
|---|---|---|
| title | Markdown 的文件标题 |
文章标题,强烈建议填写此选项 |
| date | 文件创建时的日期时间 | 发布时间,强烈建议填写此选项,且最好保证全局唯一 |
| author | 根 _config.yml 中的 author |
文章作者 |
| img | featureImages 中的某个值 |
文章特征图,推荐使用图床(腾讯云、七牛云、又拍云等)来做图片的路径.如: http://xxx.com/xxx.jpg |
| top | true |
推荐文章(文章是否置顶),如果 top 值为 true,则会作为首页推荐文章 |
| cover | false |
v1.0.2版本新增,表示该文章是否需要加入到首页轮播封面中 |
| coverImg | 无 | v1.0.2版本新增,表示该文章在首页轮播封面需要显示的图片路径,如果没有,则默认使用文章的特色图片 |
| password | 无 | 文章阅读密码,如果要对文章设置阅读验证密码的话,就可以设置 password 的值,该值必须是用 SHA256 加密后的密码,防止被他人识破。前提是在主题的 config.yml 中激活了 verifyPassword 选项 |
| toc | true |
是否开启 TOC,可以针对某篇文章单独关闭 TOC 的功能。前提是在主题的 config.yml 中激活了 toc 选项 |
| mathjax | false |
是否开启数学公式支持 ,本文章是否开启 mathjax,且需要在主题的 _config.yml 文件中也需要开启才行 |
| summary | 无 | 文章摘要,自定义的文章摘要内容,如果这个属性有值,文章卡片摘要就显示这段文字,否则程序会自动截取文章的部分内容作为摘要 |
| categories | 无 | 文章分类,本主题的分类表示宏观上大的分类,只建议一篇文章一个分类 |
| tags | 无 | 文章标签,一篇文章可以多个标签 |
| password | 无 | 文章密码 https://tool.oschina.net/encrypt?type=2, SHA256 加密方式 |
注意:
- 如果
img属性不填写的话,文章特色图会根据文章标题的hashcode的值取余,然后选取主题中对应的特色图片,从而达到让所有文章都的特色图各有特色。date的值尽量保证每篇文章是唯一的,因为本主题中Gitalk和Gitment识别id是通过date的值来作为唯一标识的。- 如果要对文章设置阅读验证密码的功能,不仅要在 Front-matter 中设置采用了 SHA256 加密的 password 的值,还需要在主题的
_config.yml中激活了配置。有些在线的 SHA256 加密的地址,可供你使用:开源中国在线工具、chahuo、站长工具。- 网易云音乐外链示例
https://music.163.com/song/media/outer/url?id=108697.mp3
背景色修改
path: themes/hexo-theme-matery/source/css/matery.css
.bg-color {
background-image: linear-gradient(
45deg,
rgba(225, 43, 40, 0.75) 0%,
rgba(52, 109, 240, 0.75) 100%
);
}
@-webkit-keyframes rainbow {
0%,
100% {
background: linear-gradient(
45deg,
rgba(225, 43, 40, 0.75) 0%,
rgba(52, 109, 240, 0.75) 100%
);
background: -moz-linear-gradient(
45deg,
rgba(225, 43, 40, 0.75) 0%,
rgba(52, 109, 240, 0.75) 100%
);
background: -webkit-linear-gradient(
45deg,
rgba(225, 43, 40, 0.75) 0%,
rgba(52, 109, 240, 0.75) 100%
);
}
}
@keyframes rainbow {
0%,
100% {
background: linear-gradient(
45deg,
rgba(225, 43, 40, 0.75) 0%,
rgba(52, 109, 240, 0.75) 100%
);
background: -moz-linear-gradient(
45deg,
rgba(225, 43, 40, 0.75) 0%,
rgba(52, 109, 240, 0.75) 100%
);
background: -webkit-linear-gradient(
45deg,
rgba(225, 43, 40, 0.75) 0%,
rgba(52, 109, 240, 0.75) 100%
);
}
}