文章类型

分为技术类文章tech(默认)和图文类文章story.

_config.stellar.yml
1
2
3
4
######## Article ########
article:
# 文章类型,决定布局风格,可以在 front-matter/topic/wiki 中覆盖此参数
type: tech # tech: 默认技术类文章, story: 图文类文章,文字和段落间增距大

文章模板

编辑post.md,根据需要选择保留部分Front-matter,其他字段根据文章需要添加.

scaffolds/post.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
# 基本信息
title: {{ title }} # 文章标题
date: {{ date }} # 文章发布日期
tags: [] # 文章标签
categories: [] # 文章分类
description: # 文章描述
# 封面
cover: # 文章封面背景 设置图片链接即可
banner: # 文章页面顶部横幅背景
poster: # 海报,可选 添加下方参数 覆盖基本信息
topic: # 标题上方的小字 可选
headline: # 大标题 必选
caption: # 标题下方的小字 可选
color: # 标题颜色 可选
# 插件
sticky: # 置顶 数字越大越靠前
mermaid: # 渲染图表
katex: # 渲染文章公式
mathjax: # 渲染文章公式
# 可选
topic: # 专栏 id
author: # 文章作者
references: # 引用文献
comments: # 设置 false 禁止评论
indexing: # 设置 false 避免被搜索
breadcrumb: # 设置 false 隐藏面包屑导航
leftbar: # 左侧边栏
rightbar: # 右侧边栏
h1: # 填写则替代`title`,设置为空 '' 隐藏标题
type: # 文章类型 tech/story
share: # 开启分享 true/false,可覆盖`_config.stellar.yml`中的全局设置
indexing: # 设置 false 避免被搜索
---

相关文章推荐

需要安装插件:hexo-related-popular-posts,插件在大规模文章下可能会增加编译时间。

1
npm install hexo-related-popular-posts --save

在主题配置文件中开启相关文章推荐功能。

_config.stellar.yml
1
2
3
4
# 相关文章推荐
related_posts:
enable: true
max_count: 5

相关文章推荐功能默认显示5篇相关文章,可在主题配置文件中修改max_count参数,首次使用需要清理缓存并生成静态文件。

参考资料

文中插入参考资料方便阅读查阅,用 markdown 格式填写引用的文章,注意要写在引号中:

/source/_posts/xxx.md
1
2
3
4
5
6
---
references:
- '[心跳之旅—💗—iOS用手机摄像头检测心率(PPG)](https://punmy.cn/2016/07/28/15231176397746.html)'
- '[PPG光电容积脉搏波描记法技术概况](https://www.jianshu.com/p/695c131abfa5)'
...
---

许可协议

更改协议内容或者自定义其他选项,支持 MarkDown 语法.

_config.stellar.yml
1
2
3
# 许可协议
article:
license: 本文章采用 [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh) 协议进行许可,转载请注明出处。

分享链接

_config.stellar.yml
1
2
# 分享
share: [wechat, weibo, email, link]

头部标签

Open Graph

默认生成 Open Graph 标签,如果您不希望生成它,可以在主题配置文件中关闭:

_config.stellar.yml
1
2
3
open_graph:
enable: true
twitter_id: # for open_graph meta

quot 强调引用