From 35fed453f1d735f7d5f9a8f85bf1058d60f3c8be Mon Sep 17 00:00:00 2001 From: Jannik Beyerstedt Date: Tue, 5 Apr 2016 23:56:20 +0200 Subject: [PATCH] [FIX] fix blueprint titles + new head title format --- site/blueprints/default.yaml | 4 +++- site/blueprints/home.yaml | 2 +- site/blueprints/redirect.yaml | 2 +- site/snippets/base/html-head.php | 14 +++++++++----- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/site/blueprints/default.yaml b/site/blueprints/default.yaml index d483094..00259f3 100644 --- a/site/blueprints/default.yaml +++ b/site/blueprints/default.yaml @@ -1,6 +1,8 @@ -title: Page +title: default Page pages: true + files: true + fields: title: label: Title diff --git a/site/blueprints/home.yaml b/site/blueprints/home.yaml index 218efd1..8376f38 100644 --- a/site/blueprints/home.yaml +++ b/site/blueprints/home.yaml @@ -1,4 +1,4 @@ -title: Page +title: Home pages: true files: true diff --git a/site/blueprints/redirect.yaml b/site/blueprints/redirect.yaml index 98565f7..c752dca 100644 --- a/site/blueprints/redirect.yaml +++ b/site/blueprints/redirect.yaml @@ -1,4 +1,4 @@ -title: Page +title: redirect pages: true files: false diff --git a/site/snippets/base/html-head.php b/site/snippets/base/html-head.php index d5ff37d..3d10050 100644 --- a/site/snippets/base/html-head.php +++ b/site/snippets/base/html-head.php @@ -5,17 +5,21 @@ // copyright: Jannik Beyerstedt | https://jannikbeyerstedt.de // license: http://www.gnu.org/licenses/gpl-3.0.txt GPLv3 License // ------------------------------------------- + +if( $page->isHomePage() ) { + $title = $site->title()->html(); +}else if ($page->depth() == 2) { + $title = $page->parent()->title()->html().': '.$page->title()->html().' | '.$site->title()->html(); +}else { + $title = $page->title()->html().' | '.$site->title()->html(); +} ?> -isHomePage() ) : ?> - <?php echo $site->title()->html() ?> - - <?php echo $site->title()->html() ?> | <?php echo $page->title()->html() ?> - + <?php echo $title ?>