2021-03-23 00:51:45 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once "./src/Element/Bookshelf.php";
|
|
|
|
|
|
|
|
class SiteMeta {
|
|
|
|
|
|
|
|
private static Bookshelf $BOOKSHELF;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @throws Exception
|
|
|
|
*/
|
|
|
|
public static function load () {
|
|
|
|
self::$BOOKSHELF = Bookshelf::parseString(file_get_contents("./data/bookshelf.xml"));
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getBookshelf(): Bookshelf {
|
|
|
|
return self::$BOOKSHELF;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getGlobalIcon (): string {
|
|
|
|
return "/favicon.ico"; // TODO ICON
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getGitbookStylesheetsList (): array {
|
|
|
|
return array(
|
2021-03-23 01:57:53 +08:00
|
|
|
"/assets/gitbook/style.css",
|
2021-04-28 14:11:38 +08:00
|
|
|
"/assets/gitbook-fix.css",
|
2021-03-23 00:51:45 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getGitbookJavascriptList (): array {
|
|
|
|
return array(
|
2021-03-23 01:57:53 +08:00
|
|
|
"/assets/gitbook/gitbook.js",
|
2021-04-26 00:10:50 +08:00
|
|
|
"/assets/gitbook-fix.js",
|
2021-03-23 00:51:45 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-05-05 13:42:29 +08:00
|
|
|
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");
|
|
|
|
}
|
|
|
|
|
2021-03-23 00:51:45 +08:00
|
|
|
}
|