0%

pdf test 3

{% pdf ./无空格的文件名.pdf %}

Get module

$ git clone https://github.com/theme-next/theme-next-pdf source/lib/pdf

to source/lib

Set it up

Enable module in NexT _config.yml file:

1
2
3
4
5
6
7
8
# PDF tag
# NexT will try to load pdf files natively, if failed, pdf.js will be used.
# So, you have to install the dependency of pdf.js if you want to use pdf tag and make it available to all browsers.
# See: https://github.com/theme-next/theme-next-pdf
pdf:
enable: true
# Default height
height: 500px

Usage

1
{% pdf /path/to/your/file.pdf %}

Test

{% pdf ./无空格的文件名.pdf %}

注意点

  1. pdf文件放在和md文件同名的文件夹中(都在_post里面)
  2. 名字中不能有空格,不然无法读取

reference

官方库:theme-next/theme-next-pdf

https://github.com/superalsrk/hexo-pdf

https://shukangzhang.com/hexo-tian-jia-pdf/

https://codeantenna.com/a/LpRluhOqxz