From 2a51b24ba9100a9504e22da3a29f653f917dbc7f Mon Sep 17 00:00:00 2001 From: GuGuMur <222153315@qq.com> Date: Thu, 27 Jul 2023 21:00:12 +0800 Subject: [PATCH] =?UTF-8?q?:ambulance:=20=E4=BF=AE=E6=AD=A3=E6=98=8E?= =?UTF-8?q?=E6=97=A5=E6=96=B9=E8=88=9F=E6=B8=B8=E6=88=8F=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=9A=84=E6=A8=A1=E6=9D=BF=E4=B8=8E=E5=9B=BE=E7=89=87=E6=B8=B2?= =?UTF-8?q?=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_bison/platform/arknights.py | 3 ++- nonebot_bison/post/templates/ark_announce/index.html | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/nonebot_bison/platform/arknights.py b/nonebot_bison/platform/arknights.py index feacf77..b988bd4 100644 --- a/nonebot_bison/platform/arknights.py +++ b/nonebot_bison/platform/arknights.py @@ -64,11 +64,12 @@ class Arknights(NewMessage): template_path=template_path, template_name="index.html", templates={ + "bannerImageUrl": raw_data["bannerImageUrl"], "announce_title": announce_title, "content": raw_data["content"], }, pages={ - "viewport": {"width": 500, "height": 6400}, + "viewport": {"width": 500, "height": 100}, "base_url": f"file://{template_path}", }, ) diff --git a/nonebot_bison/post/templates/ark_announce/index.html b/nonebot_bison/post/templates/ark_announce/index.html index 2e9374f..d85ebc2 100644 --- a/nonebot_bison/post/templates/ark_announce/index.html +++ b/nonebot_bison/post/templates/ark_announce/index.html @@ -15,6 +15,11 @@ <div class="main"> <div class="container"> <div class="standerd-container"> + {% if bannerImageUrl %} + <div class="banner-image-container"> + <img class="banner-image" src="{{ bannerImageUrl }}" /> + </div> + {% endif %} <div class="head-title-container"> <span class="head-title">{{ announce_title }}</span> </div>