From f00a421c31642d04da8a8d56d1e4f4d3647f414b Mon Sep 17 00:00:00 2001 From: Eyre_S Date: Wed, 5 May 2021 13:42:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=20css/js=20=E7=9A=84=E8=BE=93=E5=87=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 现在读取的是 data 目录下的 custom.css 和 custom.js 文件 - custom.css 会作为最后一个 子元素输出,custom.js 会在页面尾在预定义 js 输出后输出 --- src/Data/SiteMeta.php | 8 ++++++++ template/footer.php | 1 + template/header.php | 2 ++ 3 files changed, 11 insertions(+) diff --git a/src/Data/SiteMeta.php b/src/Data/SiteMeta.php index 8e498be..fffcc61 100644 --- a/src/Data/SiteMeta.php +++ b/src/Data/SiteMeta.php @@ -35,4 +35,12 @@ class SiteMeta { ); } + public static function getCustomCssContent (string $id): string { + return file_get_contents("./data/$id.css"); + } + + public static function getCustomScriptContent (string $id): string { + return file_get_contents("./data/$id.js"); + } + } diff --git a/template/footer.php b/template/footer.php index 327ca53..c923dd1 100644 --- a/template/footer.php +++ b/template/footer.php @@ -10,6 +10,7 @@ echo ""; } ?> + diff --git a/template/header.php b/template/header.php index 8a5f48c..32c3488 100644 --- a/template/header.php +++ b/template/header.php @@ -24,6 +24,8 @@ echo ""; } ?> + +