版本
- Hexo: 5.2.0
- Next: 7.8.0
说明
原生版
这个版本的 Next
自带 excerpt_description
。
在主题配置文件中可以看到
1 | # Automatically excerpt description in homepage as preamble text. |
如果开启的话,在文章的 front-matter
钟添加一个 description:
字段就可以添加文章描述了。
效果如下:
经测试,原生描述
,在展开后的正文上方也会以一行灰色小小字的形式显示。
第三方插件版
因为每次 Next
主题升级的变动还是挺大的,所以能不修改 CSS
和 layout
文件还是不修改为佳。使用第三方插件同样可以实现摘要的功能。
插件 Github 地址
fuchen/hexo-less
安装
1 | npm install --save hexo-less |
使用
Add <!-- less -->
to your post file. Behaves like <!-- more -->
, except that it will remove excerpt from content, so that excerpt can be different from content.
总结
如果开启了原生的描述
,原生的描述
的优先级高于第三方插件的优先级。且原生的插件不支持使用图片。故个人认为目前第三方插件的功能更完善和实用。