diff --git a/.htaccess b/.htaccess
index 068e7a2..a349997 100644
--- a/.htaccess
+++ b/.htaccess
@@ -1,6 +1,6 @@
# URL Rewrite
RewriteEngine On
-RewriteCond $0 !^index.php.*
-RewriteCond $0 !^debug.php.*
-RewriteCond $0 !^assets.*
+RewriteCond $0 !index.php.*
+RewriteCond $0 !debug.php.*
+RewriteCond $0 !assets.*
RewriteRule .* index.php?p=$0 [QSA]
diff --git a/constant.php b/constant.php
index 76df633..6bc618e 100644
--- a/constant.php
+++ b/constant.php
@@ -2,6 +2,6 @@
const APP_NAME = "ph-Bookshelf";
-const VERSION = "0.3.0.11";
+const VERSION = "0.3.0.12";
const CHANNEL = "suk-ws";
const BRANCH = "master";
diff --git a/index.php b/index.php
index 2db5b29..eeee0a2 100644
--- a/index.php
+++ b/index.php
@@ -24,9 +24,15 @@ try {
if (sizeof($uri) > 0 && $uri[0] != null) {
// 非主页面,判定当前定义的 book
- $tmp = SiteMeta::getBookshelf()->getBook($uri[0]);
- if ($tmp == null) throw new RequestNotExistException("Book required \"$uri[0]\" not found!");
- PageMeta::$book = $tmp->getContentedNode();
+ if ($uri[0] == "%root") {
+ PageMeta::$book = SiteMeta::getBookshelf()->getRootBook();
+ } else {
+ $tmp = SiteMeta::getBookshelf()->getBook($uri[0]);
+ if ($tmp == null)
+ throw new RequestNotExistException("Book required \"$uri[0]\" not found!");
+ PageMeta::$book = $tmp->getContentedNode();
+ }
+
// 判定当前页面
if (sizeof($uri) > 1 && $uri[1] != null) {
$tmp = PageMeta::$book->getPage($uri[1]);
diff --git a/src/Element/Book.php b/src/Element/Book.php
index d6e1d29..da50a7a 100644
--- a/src/Element/Book.php
+++ b/src/Element/Book.php
@@ -54,8 +54,20 @@ class Book {
return $this->parent;
}
- public function getHtml (): string {
- return "";
+ public function getHtml (int $indent = 0): string {
+ return sprintf(<<