diff --git a/daux.phar b/daux.phar old mode 100755 new mode 100644 index 9762295..c77e20a Binary files a/daux.phar and b/daux.phar differ diff --git a/docs/01_Features/Landing_page.md b/docs/01_Features/Landing_page.md index 9295712..78933d6 100644 --- a/docs/01_Features/Landing_page.md +++ b/docs/01_Features/Landing_page.md @@ -8,4 +8,14 @@ If you want to create a beautiful landing page for your project, create a `_inde } ``` -> The image can be a local or remote image. By default, the path is relative to the root of the documentation +> The image can be a local or remote image. By default, the path is relative to the root of the documentation. + +To disable the automatic landing page, you can set `auto_landing` to false in the `html` section of your configuration + +```json +{ + "html": { + "auto_landing": false + } +} +``` diff --git a/global.json b/global.json index 47cf4bc..37c4bca 100644 --- a/global.json +++ b/global.json @@ -29,6 +29,7 @@ "toggle_code": false, "date_modified": false, "float": false, + "auto_landing": true, "repo": "", "twitter": [], diff --git a/libs/Format/HTML/ContentPage.php b/libs/Format/HTML/ContentPage.php index f5373ac..62cd1d5 100644 --- a/libs/Format/HTML/ContentPage.php +++ b/libs/Format/HTML/ContentPage.php @@ -7,18 +7,26 @@ class ContentPage extends \Todaymade\Daux\Format\Base\ContentPage private $language; private $homepage; + private function isHomepage() + { + if (array_key_exists('auto_landing', $this->params['html']) && !$this->params['html']['auto_landing']) { + return false; + } + + if ($this->file->getParent()->getIndexPage() != $this->file) { + return false; + } + + if ($this->params['multilanguage']) { + return ($this->file->getParent()->getParent() instanceof Root); + } + + return ($this->file->getParent() instanceof Root); + } + private function initialize() { - $this->homepage = false; - if ($this->file->getParent()->getIndexPage() == $this->file) { - if ($this->params['multilanguage']) { - if ($this->file->getParent()->getParent() instanceof Root) { - $this->homepage = true; - } - } elseif ($this->file->getParent() instanceof Root) { - $this->homepage = true; - } - } + $this->homepage = $this->isHomepage(); $this->language = ''; if ($this->params['multilanguage'] && count($this->file->getParents())) { @@ -41,7 +49,7 @@ class ContentPage extends \Todaymade\Daux\Format\Base\ContentPage if (!empty($parents)) { foreach ($parents as $node) { $page = $node->getIndexPage() ?: $node->getFirstPage(); - $breadcrumb_trail[$node->getTitle()] = $page? $page->getUrl() : ''; + $breadcrumb_trail[$node->getTitle()] = $page ? $page->getUrl() : ''; } } return $breadcrumb_trail;