mirror of
https://github.com/suk-ws/ph-Bookshelf.git
synced 2024-12-05 09:26:52 +08:00
添加了 CHANNEL 和 BRANCH 声明,最下方的生成器现在会显示版本
- 修改 constant 声明 - 添加了 CHANNEL 声明程序来源 - 添加了 BRANCH 声明程序所处的更新线 - 将 get_frontpage_generate_version 移动至 SiteMeta 中 - 将 bookshelf 的 getHtml 中的主容器声明和生成器声明移至上层 - 给生成器声明添加了一个灰色小字的版本号声明 - ph-Bookshelf 的为 VERSION at CHANNEL/BRANCH - gitbook 为 VERSION
This commit is contained in:
parent
309a378303
commit
d83fb713f9
@ -68,3 +68,13 @@
|
||||
.book-summary ul.summary div.summary-container.on + li.divider.block-end {
|
||||
transform: rotateX(180deg);
|
||||
}
|
||||
|
||||
.book .book-summary ul.summary li span.annotation {
|
||||
padding: 0;
|
||||
font-size: 0.2em;
|
||||
color: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.book .book-summary ul.summary li span.annotation:hover {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
12
constant.php
12
constant.php
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
define("APP_NAME", "ph-Bookshelf");
|
||||
define("VERSION", "0.1");
|
||||
define("GITBOOK_VERSION", "3.2.3");
|
||||
const APP_NAME = "ph-Bookshelf";
|
||||
|
||||
function get_frontpage_generate_version (): string {
|
||||
return APP_NAME." ".VERSION." with Gitbook ".GITBOOK_VERSION;
|
||||
}
|
||||
const VERSION = "0.1-dev";
|
||||
const CHANNEL = "workshop-origin";
|
||||
const BRANCH = "master";
|
||||
|
||||
const GITBOOK_VERSION = "3.2.3";
|
||||
|
16
index.php
16
index.php
@ -6,6 +6,7 @@ require_once "./src/Data/PageMeta.php";
|
||||
require_once "./lib/Parsedown/Parsedown.php";
|
||||
require_once "./src/Utils/PageParse.php";
|
||||
require_once "./src/Utils/RequestNotExistException.php";
|
||||
require_once "./constant.php";
|
||||
|
||||
$parser = new Parsedown();
|
||||
|
||||
@ -76,7 +77,22 @@ try {
|
||||
</ul>
|
||||
</div>
|
||||
<nav role="navigation">
|
||||
<ul id='global-container' class='summary'>
|
||||
<?= SiteMeta::getBookshelf()->getHtml(); ?>
|
||||
<li class='divider'></li>
|
||||
<li>
|
||||
<a href='https://github.com/Eyre-S/ph-Bookshelf' target='blank' class='gitbook-link'>
|
||||
Generated with ph-Bookshelf
|
||||
<br/><span class="annotation"><?= sprintf("%s at %s/%s", VERSION, CHANNEL, BRANCH) ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='https://www.gitbook.com' target='blank' class='gitbook-link'>
|
||||
Front-End by GitBook
|
||||
<br/><span class="annotation"><?= GITBOOK_VERSION ?></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="book-body">
|
||||
|
@ -1,11 +1,16 @@
|
||||
<?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
|
||||
*/
|
||||
|
@ -71,14 +71,12 @@ class Bookshelf {
|
||||
}
|
||||
|
||||
public function getHtml (): string {
|
||||
$str = "<ul id='global-container' class='summary'>";
|
||||
$str .= $this->links->getHtml();
|
||||
$str = $this->links->getHtml();
|
||||
$str .= "<li class='divider block-start'></li><div class='summary-container" . (PageMeta::$isMainPage?" on":"") . "'>";
|
||||
$str .= $this->books->getHtml();
|
||||
$str .= "</div><li class='divider block-end'></li>";
|
||||
$str .= PageMeta::$book->getSummaryHtml();
|
||||
$str .= "<li class='divider'></li><li><a href='https://github.com/Eyre-S/ph-Bookshelf' target='blank' class='gitbook-link'>Generated with ph-Bookshelf</a></li><li><a href='https://www.gitbook.com' target='blank' class='gitbook-link'>Front-End by GitBook</a></li>";
|
||||
$str .= "</ul>";
|
||||
$str .= "";
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
<?php require_once "./constant.php" ?>
|
||||
<?php require_once "./src/Data/SiteMeta.php" ?>
|
||||
<?php require_once "./src/Data/PageMeta.php" ?>
|
||||
<!DOCTYPE HTML>
|
||||
@ -17,7 +16,7 @@
|
||||
<!-- Unused: <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png"> -->
|
||||
<title><?= PageMeta::getPageTitle() ?></title>
|
||||
<meta name="description" content="<?= PageMeta::getDescription() ?>">
|
||||
<meta name="generator" content="<?= get_frontpage_generate_version() ?>">
|
||||
<meta name="generator" content="<?= SiteMeta::get_frontpage_generate_version() ?>">
|
||||
<!-- Gitbook Assets(css) -->
|
||||
<?php
|
||||
foreach (SiteMeta::getGitbookStylesheetsList() as $item) {
|
||||
|
Loading…
Reference in New Issue
Block a user