From ed3abbdaa969fff8474d8268551a354c4b2aedbe Mon Sep 17 00:00:00 2001 From: Lex Lim Date: Sat, 7 Dec 2024 19:57:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A6=96=E9=A1=B5=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extension.json | 9 +++++++++ includes/Isekai.php | 17 ++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/extension.json b/extension.json index d98bb21..a092be2 100644 --- a/extension.json +++ b/extension.json @@ -96,6 +96,15 @@ "mobile" ] }, + "ext.isekai.styles.mainPage": { + "styles": [ + "ext.isekai.mainPage.less" + ], + "targets": [ + "desktop", + "mobile" + ] + }, "lib.isekai.echarts": { "scripts": [ "lib/echarts.custom.min.js" diff --git a/includes/Isekai.php b/includes/Isekai.php index c4b86bd..7d0680a 100644 --- a/includes/Isekai.php +++ b/includes/Isekai.php @@ -74,7 +74,13 @@ HTML ); } + if ($outputPage->getUser() && $outputPage->getUser()->isRegistered()) { + $outputPage->addBodyClasses(['logged-in']); + } + if ($isIsekaiWiki) { + self::showAds($outputPage); + // 百度统计 $outputPage->addHeadItem( 'baiduhm', @@ -90,14 +96,11 @@ var _hmt = _hmt || []; HTML ); - } - if ($outputPage->getUser() && $outputPage->getUser()->isRegistered()) { - $outputPage->addBodyClasses(['logged-in']); - } - - if ($isIsekaiWiki) { - self::showAds($outputPage); + if ($outputPage->isArticle() && $outputPage->getTitle()->isMainPage()) { + // 首页样式 + $outputPage->addModuleStyles(['ext.isekai.styles.mainPage']); + } } }