效果

在文章中能够预览PDF文件

项目地址

GitHub:hexo-pdf

安装

1
$ npm install --save hexo-pdf

语法

1
{% pdf 文件路径 %}

文件路径: 可以是相对路径或者是在线链接

1
2
3
4
# 1.本地文件:在md文件路径下创建一个同名文件夹,其内放pdf文件名为xxx.pdf的文件
{% pdf xxx.pdf %}
# 2.在线链接
{% pdf https://cdn.jsdelivr.net/gh/Justlovesmile/CDN/pdf/小作文讲义.pdf %}

用法一

1
{% pdf http://7xov2f.com1.z0.glb.clouddn.com/bash_freshman.pdf %}

用法二

1
{% pdf ./bash_freshman.pdf %}

预览效果