hexo-cdn-refresh

使用此插件可以让你在部署博客的时候就自动刷新cdn,免去了前往控制台手动刷新的步骤
项目地址

安装

npm i hexo-cdn-refresher

使用

在 hexo 或主题的配置文件中添加如下内容即可启用插件:

hacr:
  # 是否启用插件
  enable: true
  # 是否在发布后自动执行脚本
  auto_push: true
  # 网站地址
  site: https://byer.top/
  Access:
  # 阿里云CDN Access Token
    accessKeyId: L##########################2
    accessKeySecret: 9######################EH
  RefreshOpts:
    # 刷新类型 refresh刷新 push预热 both刷新cdn后预热
    type: refresh
    # 刷新目录directory 刷新文件file并在_data中创建refresh-list.json文件内容为["https://byer.top/1.png","https://byer.top/2.png"]
    method: directory
    # 设置both时的预热延迟时间
    time: 60000

  • 输入hexo hacr手动刷新cdn
  • 将配置改为auto_push: true,这样将不能使用hexo hacr手动刷新