在写文章时,需要引用站内文章,可以通过标签插件(Tag Plugins)来实现。
参见包含帖子,包含到其他帖子的链接,可以使用命令:
1 2 3 4 5
| {% post_path filename %} {% post_link filename [title] [escape] %}
默认链接文字是文章的标题,你也可以自定义要显示的文本。 默认对文章的标题和自定义标题里的特殊字符进行转义。 可以使用 escape 选项,禁止对特殊字符进行转义。
|
进行自引用,可以查看预览如下:
1
| {% post_link Tutorial/Hexo/use_hexo_post_link %}
|
Hexo引用站内文章
1
| {% post_link Tutorial/Hexo/use_hexo_post_link '自定义标题'%}
|
自定义标题
1
| {% post_link Tutorial/Hexo/use_hexo_post_link '禁止转义' false%}
|
禁止转义
- filename是不添加md后缀的文件名字;
- 工作路径以 _post 路径为基,如果文章没有放置在基目录之下,需要提供相对基目录的路径。