Skip to content

Commit

Permalink
fix: 天气插件
Browse files Browse the repository at this point in the history
  • Loading branch information
TRHX committed Jul 20, 2024
1 parent cfe62b6 commit 26088fb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 28 deletions.
4 changes: 2 additions & 2 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ publishDir = "docs" # 站点静态文件保存目录
tj51laid = "3FcHt9RWSQ8XvN5u" # 51.LA 网站统计
tj51lack = "3FcHt9RWSQ8XvN5u"

[params.qweather]
key = "085791e805a24491b43b06cf58ab31e7"
[params.seniverse]
key = "a39cd5a0-4024-4cb2-85c6-0250317058db"

[params.images]
favicon = "images/favicon.ico"
Expand Down
5 changes: 5 additions & 0 deletions themes/webstack/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,11 @@ a>i.sidebar-more {
float: right;
}

.weather span {
color: #ffffff !important;
font-size: 14px;
}

.navbar-brand img {
max-height: 40px
}
Expand Down
41 changes: 15 additions & 26 deletions themes/webstack/layouts/partials/content_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,34 +67,23 @@
</div>

<ul class="nav navbar-menu text-xs order-1 order-md-2">
<!-- 天气系统 -->
<!-- 天气系统 https://www.seniverse.com/widget -->
<div class="rounded-circle weather">
<div id="he-plugin-simple" style="display: contents;"></div>
<script>WIDGET = {
CONFIG: {
"modules": "01234",
"background": 5,
"tmpColor": "E4C600",
"tmpSize": 14,
"cityColor": "E4C600",
"citySize": 14,
"aqiColor": "#E4C600",
"aqiSize": 14,
"weatherIconSize": 24,
"alertIconSize": 18,
"padding": "10px 10px 10px 10px",
"shadow": "1",
"language": "auto",
"borderRadius": 5,
"fixed": "false",
"vertical": "middle",
"horizontal": "left",
"key": "{{ $.Site.Params.qweather.key }}"
}
}
<div id="tp-weather-widget" style="padding-right: 20px"></div>
<script>
(function(a,h,g,f,e,d,c,b){b=function(){d=h.createElement(g);c=h.getElementsByTagName(g)[0];d.src=e;d.charset="utf-8";d.async=1;c.parentNode.insertBefore(d,c)};a["SeniverseWeatherWidgetObject"]=f;a[f]||(a[f]=function(){(a[f].q=a[f].q||[]).push(arguments)});a[f].l=+new Date();if(a.attachEvent){a.attachEvent("onload",b)}else{a.addEventListener("load",b,false)}}(window,document,"script","SeniverseWeatherWidget","//cdn.sencdn.com/widget2/static/js/bundle.js?t="+parseInt((new Date().getTime() / 100000000).toString(),10)));
window.SeniverseWeatherWidget('show', {
flavor: "slim",
location: "WX4FBXXFKE4F",
geolocation: true,
language: "auto",
unit: "c",
theme: "auto",
token: "{{ $.Site.Params.seniverse.key }}",
hover: "enabled",
container: "tp-weather-widget",
})
</script>
<script
src="https://widget.qweather.net/simple/static/js/he-simple-common.js?v=2.0"></script>
</div>
<!-- 一言 -->
{{ with .Site.Params.yiyan }}
Expand Down

0 comments on commit 26088fb

Please sign in to comment.