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

Idea from https://discuss.gohugo.io/t/how-to-name-list-templates/949
This commit is contained in:
Anthony Fok 2015-11-16 06:48:20 -07:00
parent 5c6d8c57b9
commit acd720df92
2 changed files with 6 additions and 4 deletions

2
docs/data/titles.toml Normal file
View file

@ -0,0 +1,2 @@
[Showcase]
title = "Site Showcase"

View file

@ -7,8 +7,8 @@
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }} {{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
{{ .Hugo.Generator }} {{ .Hugo.Generator }}
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
{{ .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>{{.Title}}</title> <title>Hugo - {{ .Scratch.Get "title" }}</title>
<link href="/css/bootstrap-theme.css" rel="stylesheet"> <link href="/css/bootstrap-theme.css" rel="stylesheet">
<link href="/assets/font-awesome/css/font-awesome.min.css" rel="stylesheet" /> <link href="/assets/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
@ -42,7 +42,7 @@
</div> </div>
<div class="nav title-row" id="top_menu"> <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> </div>
</header> </header>
<!--header end--> <!--header end-->
@ -78,7 +78,7 @@
<div class="col-md-10"> <div class="col-md-10">
<section class="panel"> <section class="panel">
<!--<header class="panel-heading">--> <!--<header class="panel-heading">-->
<!--<h3>{{.Title}}</h3>--> <!--<h3>{{ .Scratch.Get "title" }}</h3>-->
<!--</header>--> <!--</header>-->
<div class="panel-body"> <div class="panel-body">
<div class="row"> <div class="row">