确保您看到本篇文章能解决问题,文末以具体主题(默认主题)为例设置阅读更多。
加入代码
在你想要出现的地方加入下面代码
1 | <!-- more --> |
设置无效
比如butterfly
主题不支持,设置无效,可以换next
或者默认landscape
。
hexo-theme-landscape 设置 Read More
初始化
1 | npm install hexo && npx hexo init blog && cd blog |
配置
写文章并设置阅读全文
1 | hexo n test |
打开blog/source/_posts/test.md
1 | --- |
预览
1 | npx hexo clean && npx hexo server |
默认会显示英文Read More
中文
_config.yml
的language: en
改成language: zh-CN
_config.yml
添加
1 | excerpt_link: 阅读更多 |
总结
这是文章截断的方法,<!-- more -->
只对hexo
且支持的主题有效,在markdown 中添加太多的hexo 标签,其实会在以后用其他编辑器预览,查看,迁移时留下诸多不变,毕竟,私有的语法意味着不兼容,但是其实这种语法用编辑器批量替换还是很容易的。
ps:hexo-theme-landscape
的<!-- more -->
没有i18n
,不建议使用默认主题。
参考
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Ln's Blog!
评论