使用GitHub Action在服务器同步Hexo博客信息
本文章只是记录一下步骤,如果你想看更加详细的文章,可以参考以下内容: https://cloud.tencent.com/developer/article/1720500 https://github.com/marketplace/actions/ssh-deploy 新建 GitHub Action在.github/workflows目录下新建deploy.yml文件,内容如下: 1234567891011121314151617181920212223242526272829303132name: deployon: push: branches: - mainjobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Node uses: actions/setup-node@v4 with: cache: &q...
使用iframe预览pdf文件
我希望可以在网页中使用 iframe 预览 pdf 文件,于是我打算使用 pdf.js,在使用的过程中也遇到了一些坑,于是在这里记录下来。 下载去https://github.com/mozilla/pdf.js/releases下载最新的代码,解压。 修改源码在web目录下,找到viewer.html,打开,在<head>标签下,添加以下内容: 1<meta name="referrer" content="same-origin" /> 在web目录下,打开viewer.mjs,找到HOSTED_VIEWER_ORIGINS变量,根据你的网址修改它的值。为了确保当前页面是你的服务器,建议只修改HOSTED_VIEWER_ORIGINS的值,而不是像网上的某些做法一样去除同源检查。 12345const HOSTED_VIEWER_ORIGINS = [ "null", "https://www.yanceymc.cn", "https://yancey20...
