确保您看到本篇文章能解决问题,文末以具体主题(默认主题)为例设置阅读更多。

加入代码

在你想要出现的地方加入下面代码

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
2
3
4
5
6
7
8
9
10
11
---
title: test
date: 2021-01-14 14:17:13
tags:
---

阅读更多

<!-- more -->

这是阅读更多之后的内容

预览

1
npx hexo clean && npx hexo server

http://localhost:4000

默认会显示英文Read More

中文

_config.ymllanguage: en改成language: zh-CN

_config.yml添加

1
excerpt_link: 阅读更多

总结

这是文章截断的方法,<!-- more -->只对hexo且支持的主题有效,在markdown 中添加太多的hexo 标签,其实会在以后用其他编辑器预览,查看,迁移时留下诸多不变,毕竟,私有的语法意味着不兼容,但是其实这种语法用编辑器批量替换还是很容易的。

ps:hexo-theme-landscape<!-- more -->没有i18n,不建议使用默认主题。

参考

https://hexo.io/zh-cn/docs/tag-plugins#%E6%96%87%E7%AB%A0%E6%91%98%E8%A6%81%E5%92%8C%E6%88%AA%E6%96%AD