hexo博客配置-插入各类文件

本文所用的架构或思路参考该文:hexo博客配置-主题管理与配置

插入自己的博客或post的链接

1
2
{% post_path slug %}
{% post_link slug [title] %}

post_path hello-world的方式得到:/2018-08-15-16107.html

post_link hello-world 世界你好!的效果是:世界你好!

参考:hexo-tag-plugins

插入代码文件

先修改总的_config.yml

1
code_dir: ./ #表示从source目录开始

然后在要插入代码的md文件里相对source目录写文件路径

1
{% include_code [title] [lang:language] path/to/file %}

参考:hexo-tag-plugins

插入markdown文件

安装hexo-include-markdown

1
npm install hexo-include-markdown --save

在总的_config.yml里添加

1
2
3
include_markdown:
dir: source/ # Base directory of template markdown
verbose : true # If you want to check the path of markdown that use <!-- md --> tag , please set the true.

在md文件里添加相对于source的路径

1
<!-- md path/to/template.md -->

参考:hexo-include-markdown

插入其他文件

插入视频、图片等等,网上可收集的实在多,不赘述。归根结底,要么写Markdown语法,要么参考官网添加tag的方式,即如下网址:

hexo-tag-plugins英文说明

hexo-tag-plugins中文说明

Donate comment here
xiaotiandi 微信支付

微信支付

xiaotiandi 支付宝

支付宝

xiaotiandi

公益(commonweal)微信