mirror of
https://github.com/suk-ws/ph-Bookshelf.git
synced 2024-12-05 09:26:52 +08:00
添加了自定义 css/js 的输出功能
- 现在读取的是 data 目录下的 custom.css 和 custom.js 文件 - custom.css 会作为最后一个 <head> 子元素输出,custom.js 会在页面尾在预定义 js 输出后输出
This commit is contained in:
parent
55610855f4
commit
f00a421c31
@ -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");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
echo "<script src=\"$item\"></script>";
|
echo "<script src=\"$item\"></script>";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
<script><?= SiteMeta::getCustomScriptContent("custom") ?></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
echo "<link rel=\"stylesheet\" href=\"$item\">";
|
echo "<link rel=\"stylesheet\" href=\"$item\">";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
<!-- Customs(css) -->
|
||||||
|
<style><?= SiteMeta::getCustomCssContent("custom") ?></style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="book">
|
<div class="book">
|
||||||
|
Loading…
Reference in New Issue
Block a user