parent
5997820360
commit
a3ebedb7e3
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
"toggle_code": false,
|
"toggle_code": false,
|
||||||
"date_modified": false,
|
"date_modified": false,
|
||||||
"float": false,
|
"float": false,
|
||||||
|
"auto_landing": true,
|
||||||
|
|
||||||
"repo": "",
|
"repo": "",
|
||||||
"twitter": [],
|
"twitter": [],
|
||||||
|
@ -7,18 +7,26 @@ class ContentPage extends \Todaymade\Daux\Format\Base\ContentPage
|
|||||||
private $language;
|
private $language;
|
||||||
private $homepage;
|
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()
|
private function initialize()
|
||||||
{
|
{
|
||||||
$this->homepage = false;
|
$this->homepage = $this->isHomepage();
|
||||||
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->language = '';
|
$this->language = '';
|
||||||
if ($this->params['multilanguage'] && count($this->file->getParents())) {
|
if ($this->params['multilanguage'] && count($this->file->getParents())) {
|
||||||
@ -41,7 +49,7 @@ class ContentPage extends \Todaymade\Daux\Format\Base\ContentPage
|
|||||||
if (!empty($parents)) {
|
if (!empty($parents)) {
|
||||||
foreach ($parents as $node) {
|
foreach ($parents as $node) {
|
||||||
$page = $node->getIndexPage() ?: $node->getFirstPage();
|
$page = $node->getIndexPage() ?: $node->getFirstPage();
|
||||||
$breadcrumb_trail[$node->getTitle()] = $page? $page->getUrl() : '';
|
$breadcrumb_trail[$node->getTitle()] = $page ? $page->getUrl() : '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $breadcrumb_trail;
|
return $breadcrumb_trail;
|
||||||
|
Loading…
Reference in New Issue
Block a user