Hexo-next-添加pdf插件
People who are crazy enough to think they can change the world, are the ones who do.
— Apple Computers
本文由 简悦 SimpRead 转码, 原文地址 blog.csdn.net
需求:
希望能在 GitHub 搭建的博客中上传本地 PDF 文件,同时提供下载功能。
一、安装插件
1 | 在博客bash中执行下列命令安装 |
next/_config.yml
或_config.next.yml
中修改此处:打开 pdf功能
1 | # PDF tag |
编写方法
在md 文件中添加 pdf
1 | 外部链接: |
建立页面
若建立页面如下图,
在博客 source\
,文件夹下创建一个文件夹如books
,内部新建 index.md
, 同时需要再创建一个同名的 test 文件夹,放我们要上传的 PDF 文章
创建 book 页面
1 | --- |
还要如图设置:
建立文章
外部文章网页链接
1 | {% pdf http://7xov2f.com1.z0.glb.clouddn.com/bash_freshman.pdf %} |
在博客 source\_posts\
,文件夹下创建一个文章如 test.md
, 同时需要再创建一个同名的 test 文件夹,放我们要上传的 PDF 文章
1 | --- |
最后使用命令:hexo g 生成; hexo d 发布后,即可实现需求