1. 安装插件,在博客根目录 [Blogroot] 下打开终端,运行以下指令:

    1
    npm install hexo-butterfly-clock --save
  2. 添加配置信息,以下为写法示例
    在站点配置文件 _config.yml 或者主题配置文件 _config.butterfly.yml 中添加:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    # electric_clock
    electric_clock:
    enable: true # 开关
    priority: 5 #过滤器优先权
    enable_page: all # 应用页面
    exclude:
    # - /posts/
    # - /about/
    layout: # 挂载容器类型
    type: class
    name: sticky_layout
    index: 0
    loading: https://npm.elemecdn.com/hexo-butterfly-clock/lib/loading.gif #加载动画自定义
    clock_css: https://npm.elemecdn.com/hexo-butterfly-clock/lib/clock.min.css
    clock_js: https://npm.elemecdn.com/hexo-butterfly-clock/lib/clock.min.js
    ip_api: https://pv.sohu.com/cityjson?ie=utf-8

参考链接:https://haiyong.site/post/22e1d5da.html