Socket
Socket
Sign inDemoInstall

hexo-butterfly-clock-anzhiyu

Package Overview
Dependencies
55
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    hexo-butterfly-clock-anzhiyu

A clock card plugin for theme-butterfly


Version published
Weekly downloads
410
increased by19.19%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

hexo-butterfly-clock

hexo-theme-butterfly添加 侧边栏电子钟

安装

  1. 如果有安装店长的插件版侧边栏电子钟(与店长的电子钟冲突),在博客根目录[Blogroot]下打开终端,运行以下指令
  # 卸载原版电子钟
  npm uninstall hexo-butterfly-clock
  1. 安装插件,在博客根目录[Blogroot]下打开终端,运行以下指令:

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

       # electric_clock
       # see https://anzhiy.cn/posts/fc18.html
       electric_clock:
         enable: true # 开关
         priority: 5 #过滤器优先权
         enable_page: all # 应用页面
         exclude:
           # - /posts/
           # - /about/
         layout: # 挂载容器类型
           type: class
           name: sticky_layout
           index: 0
         loading: https://cdn.cbd.int/hexo-butterfly-clock-anzhiyu/lib/loading.gif #加载动画自定义
         clock_css: https://cdn.cbd.int/hexo-butterfly-clock-anzhiyu/lib/clock.min.css
         clock_js: https://cdn.cbd.int/hexo-butterfly-clock-anzhiyu/lib/clock.js
         ip_api: https://widget.qweather.net/simple/static/js/he-simple-common.js?v=2.0
         qweather_key:  # 和风天气key
         gaud_map_key:  # 高得地图web服务key
         default_rectangle: false # 开启后将一直显示rectangle位置的天气,否则将获取访问者的地理位置与天气
         rectangle: 112.6534116,27.96920845 # 获取访问者位置失败时会显示该位置的天气,同时该位置为开启default_rectangle后的位置
    

    其中qweather_keygaud_map_key最好自己去申请对应的api key,默认使用我自己的,可能会被限制,不保证可靠性

    qweather_key申请地址: https://id.qweather.com/#/login

    1. 登录后进入控制台 和风天气控制台
    2. 创建应用 创建和风天气应用
    3. 填写应用名称和key名称随意
    4. 选择WebApi 选择WebApi
    5. 复制key 复制key

    gaud_map_key 申请地址: https://lbs.amap.com/

    1. 登录后进入控制台
    2. 创建应用,名称随意,类型选其他 创建应用
    3. 点击添加, key名称随意,服务平台选择Web服务,点击提交 Web服务
    4. 复制key 复制key
  3. 参数释义

参数备选值/类型释义
prioritynumber【可选】过滤器优先级,数值越小,执行越早,默认为10,选填
enabletrue/false【必选】控制开关
enable_pagepath【可选】填写想要应用的页面,如根目录就填'/',分类页面就填'/categories/'。若要应用于所有页面,就填all,默认为all
excludepath【可选】填写想要屏蔽的页面,可以多个。写法见示例。原理是将屏蔽项的内容逐个放到当前路径去匹配,若当前路径包含任一屏蔽项,则不会挂载。
layout.typeid/class【可选】挂载容器类型,填写id或class,不填则默认为id
layout.nametext【必选】挂载容器名称
layout.index0和正整数【可选】前提是layout.type为class,因为同一页面可能有多个class,此项用来确认究竟排在第几个顺位
loadingURL【可选】电子钟加载动画的图片
clock_cssURL【可选】电子钟样式CDN资源
clock_jsURL【可选】电子钟执行脚本CDN资源
ip_apiURL【可选】获取时钟IP的API
qweather_key【可选】和风天气key
gaud_map_key【可选】高得地图web服务key
default_rectangle【可选】和风天气key
rectangle【可选】高得地图web服务key

截图

Keywords

FAQs

Last updated on 16 Sep 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc