From 029610411839e485e4111776b9b0fa041cf23da6 Mon Sep 17 00:00:00 2001 From: Gautham Warrier Date: Mon, 11 Aug 2014 11:28:05 +0530 Subject: [PATCH] Add 'index.html' suffix to url for Landing Pages in Static Generation --- libs/daux.php | 1 + templates/default.tpl | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/libs/daux.php b/libs/daux.php index 17aef54..6609e20 100644 --- a/libs/daux.php +++ b/libs/daux.php @@ -190,6 +190,7 @@ $params['local_base'] = $this->local_base; if ($mode === '') $mode = $this->mode; + $params['mode'] = $mode; switch ($mode) { case ErrorPage::FATAL_ERROR_TYPE: $params['error_type'] = ErrorPage::FATAL_ERROR_TYPE; diff --git a/templates/default.tpl b/templates/default.tpl index 6dba6b2..2317e5b 100644 --- a/templates/default.tpl +++ b/templates/default.tpl @@ -2,14 +2,14 @@ namespace Todaymade\Daux; class Template { - private function get_navigation($tree, $path, $current_url, $base_page) { + private function get_navigation($tree, $path, $current_url, $base_page, $mode) { $nav = ''; return $nav; } - private function build_navigation($tree, $path, $current_url, $base_page) { + private function build_navigation($tree, $path, $current_url, $base_page, $mode) { $nav = ''; foreach ($tree->value as $url => $node) { if ($node->type === \TodayMade\Daux\Directory_Entry::FILE_TYPE) { @@ -23,12 +23,13 @@ $link = ($path === '') ? $url : $path . '/' . $url; if (strpos($current_url, $link) === 0) $nav .= ' class="open"'; $nav .= ">"; + if ($mode === \TodayMade\Daux\Daux::STATIC_MODE) $link .= "/index.html"; if ($node->index_page) $nav .= '' . utf8_encode($node->title) . ''; else $nav .= '' . utf8_encode($node->title) . ''; $nav .= ''; } } @@ -192,8 +193,8 @@