Support optional head and footer partials.
This commit is contained in:
parent
ceb809eeaa
commit
a68a2104c6
2 changed files with 17 additions and 1 deletions
|
|
@ -352,6 +352,15 @@ Upload your image to [RealFaviconGenerator](https://realfavicongenerator.net/) t
|
|||
Then set the "realfavicongenerator" param to true to add the needed meta tags. Also good to set the "themeColor" param to correct colour.
|
||||
|
||||
|
||||
### Head and footer partials
|
||||
|
||||
If you create partials named `head.html` and/or `footer.html` they will be used. They do not exist in the theme but are supported as a convenience.
|
||||
|
||||
Content in the "head" partial will be added to the end of the "head" tag, perhaps some extra css or javascript.
|
||||
|
||||
Content in the "footer" partial will replace all the default content in the "footer" tag.
|
||||
|
||||
|
||||
### Layouts
|
||||
|
||||
To customise a layout included in the zen theme, copy it to the root layout directory and edit it there. Make sure to maintain the directory structure inside the layouts directory.
|
||||
|
|
|
|||
|
|
@ -6,11 +6,14 @@
|
|||
<title>{{ block "title" . }}{{ .Title }} – {{ site.Title }}{{ end }}</title>
|
||||
{{ partial "meta.html" . }}
|
||||
{{ partialCached "styles.html" . }}
|
||||
{{- block "head" . }}{{ end }}
|
||||
{{ partial "meta_json_ld.html" . }}
|
||||
{{ partial "scripts.html" . }}
|
||||
{{ partial "math.html" . }}
|
||||
{{ partialCached "tracking.html" . }}
|
||||
{{ if templates.Exists "partials/head.html" -}}
|
||||
{{ partial "head.html" . }}
|
||||
{{ end -}}
|
||||
{{ block "head" . }}{{ end }}
|
||||
</head>
|
||||
|
||||
<body class="{{ if .IsPage }}single-page{{ else }}list-page{{ end }}{{ if .IsHome }} front{{ end }}{{ with $.Param "bodyclass" }} {{ . }}{{ end }}">
|
||||
|
|
@ -38,10 +41,14 @@
|
|||
{{ if $.Param "sidebar" }}{{ partial "sidebar.html" . }}{{ end -}}
|
||||
|
||||
<footer class="footer layout__footer mt--l">
|
||||
{{ if templates.Exists "partials/footer.html" -}}
|
||||
{{ partial "footer.html" . }}
|
||||
{{ else -}}
|
||||
{{ if $.Param "feedlinks" }}{{ partial "feedlinks.html" . }}{{ end -}}
|
||||
<p>{{ with $.Param "copyright" }}{{ . | markdownify }}{{ else }}<span>© {{ site.Title }}</span>{{ end }}</p>
|
||||
{{ with $.Param "footer" }}<p>{{ . | markdownify }}</p>{{ end }}
|
||||
{{ if $.Param "poweredby" }}<p>Powered by <a href="https://gohugo.io/">Hugo</a> and the <a href="https://github.com/frjo/hugo-theme-zen">Zen theme</a>.</p>{{ end }}
|
||||
{{ end -}}
|
||||
</footer>
|
||||
|
||||
{{ if $.Param "cookieconsent" }}{{ partialCached "cookieconsent.html" . }}{{ end -}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue