Move site header and footer to the base template, and override the body block in index
This commit is contained in:
parent
19d8209cb2
commit
8fadc54a43
3 changed files with 17 additions and 21 deletions
|
|
@ -1,16 +1,18 @@
|
|||
{{ define "main" }}
|
||||
<div class="platter grid">
|
||||
<h1 class="site">{{ .Title }}</h1>
|
||||
<div id="content">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
{{- with site.Menus.main -}}
|
||||
{{ define "body" }}
|
||||
<main>
|
||||
<div class="platter grid">
|
||||
<h1 class="site">{{ .Title }}</h1>
|
||||
<div id="content">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
{{- with site.Menus.main -}}
|
||||
{{- $url := $.RelPermalink -}}
|
||||
<nav class="site bulleted">
|
||||
{{- range . -}}
|
||||
<li><a class="{{ if eq .URL $url }}active{{ end }}" href="{{ .URL }}"><span>{{ i18n .Identifier | default .Name }}</span></a></li>
|
||||
<li><a class="{{ if eq .URL $url }}active{{ end }}" href="{{ .URL }}"><span>{{ i18n .Identifier | default .Name }}</span></a></li>
|
||||
{{- end -}}
|
||||
</nav>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</main>
|
||||
{{ end }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue