butterfly插件化天气窗口

butterfly插件化天气窗口

更新日志

2021.7.12:修复bug,适配3.8.1

效果

image-20210311105220717

方法

前往和风天气生成一段代码。

你会得到一段类似这样的代码:

image-20210311105629935

记录下你的key

添加weather.pug

前往ROOT\themes\butterfly\layout\includes

新建weather.pug,填入下列代码:

#he-plugin-standard
script.
  WIDGET = {
  "CONFIG": {
  "layout": 1,
  "width": "100%",
  "height": "230",
  "dataColor": "ffffff",
  "background": 1,
  "borderRadius": "!{theme.weather.radius}",
  "modules": "01",
  "key": "!{theme.weather.key}"
  }
  }
script(src='https://cdn.nesxc.com/js/he-standard-common.js')

修改index.pug

打开ROOT\themes\butterfly\layout修改index.pug

include includes/pagination.pug这段的代码后面添加:

diff

    +postUI
    include includes/pagination.pug
    if theme.weather.enable
+     .recent-weather(style='width:100%;height:230px')
+       include ./includes/weather.pug

成品

    +postUI
    include includes/pagination.pug
    if theme.weather.enable
      .recent-weather(style='width:100%;height:230px')
        include ./includes/weather.pug

修改_confing.butterfly.yml

添加下列代码:

#天气插件
weather:
  enable: true #开关
  radius: 8 #圆角-越大越圆
  key: youkey #key

把上述代码中的youkey换成你之前生成代码的key即可。

生成

正常的hexo三连就可看到效果了哦~

© 版权声明
THE END
点赞11赞赏 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容