1
0
mirror of https://github.com/suk-ws/ph-Bookshelf.git synced 2025-02-24 23:20:52 +08:00
ph-Bookshelf/src/Data/SiteMeta.php
Eyre_S d83fb713f9
添加了 CHANNEL 和 BRANCH 声明,最下方的生成器现在会显示版本
- 修改 constant 声明
  - 添加了 CHANNEL 声明程序来源
  - 添加了 BRANCH 声明程序所处的更新线
  - 将 get_frontpage_generate_version 移动至 SiteMeta 中
- 将 bookshelf 的 getHtml 中的主容器声明和生成器声明移至上层
- 给生成器声明添加了一个灰色小字的版本号声明
  - ph-Bookshelf 的为 VERSION at CHANNEL/BRANCH
  - gitbook 为 VERSION
2021-05-10 12:09:29 +08:00

52 lines
1.1 KiB
PHP

<?php
require_once "./src/Element/Bookshelf.php";
require_once "./constant.php";
class SiteMeta {
private static Bookshelf $BOOKSHELF;
static function get_frontpage_generate_version (): string {
return APP_NAME." ".VERSION." with Gitbook ".GITBOOK_VERSION;
}
/**
* @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(
"/assets/gitbook/style.css",
"/assets/gitbook-fix.css",
);
}
public static function getGitbookJavascriptList (): array {
return array(
"/assets/gitbook/gitbook.js",
"/assets/gitbook-fix.js",
);
}
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");
}
}