hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit acd720df9214f8926758473c0656e2a8fcf023db
parent 5c6d8c57b957b486fdb9dab2015362118ee8f126
Author: Anthony Fok <foka@debian.org>
Date:   Mon, 16 Nov 2015 06:48:20 -0700

Add docs/data/titles.toml to set title "Site Showcase"

Idea from https://discuss.gohugo.io/t/how-to-name-list-templates/949

Diffstat:
Adocs/data/titles.toml | 2++
Mdocs/layouts/partials/header.html | 8++++----
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/docs/data/titles.toml b/docs/data/titles.toml
@@ -0,0 +1,2 @@
+[Showcase]
+title = "Site Showcase"
diff --git a/docs/layouts/partials/header.html b/docs/layouts/partials/header.html
@@ -7,8 +7,8 @@
     {{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
     {{ .Hugo.Generator }}
     <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
-
-    <title>{{.Title}}</title>
+{{ .Scratch.Add "title" "" }}{{ if isset .Site.Data.titles .Title }}{{ .Scratch.Set "title" (index .Site.Data.titles .Title).title }}{{ else }}{{ .Scratch.Set "title" .Title}}{{end}}
+    <title>Hugo - {{ .Scratch.Get "title" }}</title>
 
     <link href="/css/bootstrap-theme.css" rel="stylesheet">
     <link href="/assets/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
@@ -42,7 +42,7 @@
             </div>
 
             <div class="nav title-row" id="top_menu">
-                <h1 class="nav top-menu">{{.Title}}</h1>
+                <h1 class="nav top-menu">{{ .Scratch.Get "title" }}</h1>
             </div>
       </header>
       <!--header end-->
@@ -78,7 +78,7 @@
                 <div class="col-md-10">
                     <section class="panel">
                           <!--<header class="panel-heading">-->
-                              <!--<h3>{{.Title}}</h3>-->
+                              <!--<h3>{{ .Scratch.Get "title" }}</h3>-->
                           <!--</header>-->
                     <div class="panel-body">
                         <div class="row">