mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
config: adjust to changes in Hugo 0.120 #693
This commit is contained in:
parent
bb76d25145
commit
7665a4aeca
5 changed files with 77 additions and 18 deletions
|
@ -212,7 +212,6 @@ title = "Hugo Relearn Theme"
|
||||||
images = ["images/hero.png"]
|
images = ["images/hero.png"]
|
||||||
editURL = "https://github.com/McShelby/hugo-theme-relearn/edit/main/exampleSite/content/"
|
editURL = "https://github.com/McShelby/hugo-theme-relearn/edit/main/exampleSite/content/"
|
||||||
description = "Documentation for Hugo Relearn Theme"
|
description = "Documentation for Hugo Relearn Theme"
|
||||||
author = "Sören Weber"
|
|
||||||
showVisitedLinks = true
|
showVisitedLinks = true
|
||||||
collapsibleMenu = true
|
collapsibleMenu = true
|
||||||
disableBreadcrumb = false
|
disableBreadcrumb = false
|
||||||
|
@ -233,6 +232,8 @@ title = "Hugo Relearn Theme"
|
||||||
# security reasons
|
# security reasons
|
||||||
mermaidInitialize = "{ \"securityLevel\": \"loose\" }"
|
mermaidInitialize = "{ \"securityLevel\": \"loose\" }"
|
||||||
mermaidZoom = true
|
mermaidZoom = true
|
||||||
|
[params.author]
|
||||||
|
name = "Sören Weber"
|
||||||
[params.siteparam.test]
|
[params.siteparam.test]
|
||||||
text = "A **nested** parameter <b>with</b> formatting"
|
text = "A **nested** parameter <b>with</b> formatting"
|
||||||
[params.imageEffects]
|
[params.imageEffects]
|
||||||
|
|
|
@ -1,8 +1,30 @@
|
||||||
{{- partialCached "page-meta.hugo" . .RelPermalink }}
|
{{- partialCached "page-meta.hugo" . .RelPermalink }}
|
||||||
|
{{- /* Deprecate site.Author.email in favor of site.Params.author.email */}}
|
||||||
|
{{- $authorEmail := "" }}
|
||||||
|
{{- if and .Site.Params.author (reflect.IsMap .Site.Params.author) .Site.Params.author.email }}
|
||||||
|
{{- $authorEmail = .Site.Params.author.email }}
|
||||||
|
{{- else }}
|
||||||
|
{{- with .Site.Author.email }}
|
||||||
|
{{- $authorEmail = . }}
|
||||||
|
{{- warnf "The author key in site configuration is deprecated. Use params.author.email instead." }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- /* Deprecate site.Author.name in favor of site.Params.author.name */}}
|
||||||
|
{{- $authorName := "" }}
|
||||||
|
{{- if and .Site.Params.author (reflect.IsMap .Site.Params.author) .Site.Params.author.name }}
|
||||||
|
{{- $authorName = .Site.Params.author.name }}
|
||||||
|
{{- else }}
|
||||||
|
{{- with .Site.Author.name }}
|
||||||
|
{{- $authorName = . }}
|
||||||
|
{{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- $pages := .Page.Pages }}
|
{{- $pages := .Page.Pages }}
|
||||||
{{- $limit := .Site.Config.Services.RSS.Limit -}}
|
{{- $limit := .Site.Config.Services.RSS.Limit }}
|
||||||
{{- if ge $limit 0 -}}
|
{{- if ge $limit 0 }}
|
||||||
{{- $pages = $pages | first $limit -}}
|
{{- $pages = $pages | first $limit }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $page := . }}
|
{{- $page := . }}
|
||||||
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
||||||
|
@ -12,12 +34,12 @@
|
||||||
<link>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</link>
|
<link>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</link>
|
||||||
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
||||||
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
|
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
|
||||||
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
|
<language>{{ . }}</language>{{end}}{{ with $authorEmail }}
|
||||||
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
|
<managingEditor>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with $authorEmail }}
|
||||||
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
|
<webMaster>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with .Site.Copyright }}
|
||||||
<copyright>{{ . }}</copyright>{{ end }}{{ if not .Date.IsZero }}
|
<copyright>{{ . }}</copyright>{{ end }}{{ if not .Date.IsZero }}
|
||||||
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
|
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
|
||||||
{{- with .OutputFormats.Get "RSS" -}}
|
{{- with .OutputFormats.Get "RSS" }}
|
||||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" ( partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true)) .MediaType | safeHTML }}
|
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" ( partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true)) .MediaType | safeHTML }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- range $pages }}
|
{{- range $pages }}
|
||||||
|
@ -27,9 +49,7 @@
|
||||||
<title>{{ .Title }}</title>
|
<title>{{ .Title }}</title>
|
||||||
<link>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</link>
|
<link>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</link>
|
||||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||||
{{- with .Site.Author.email }}
|
{{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }}
|
||||||
<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>
|
|
||||||
{{- end }}
|
|
||||||
<guid>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</guid>
|
<guid>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</guid>
|
||||||
<description>{{ .Summary | html }}</description>
|
<description>{{ .Summary | html }}</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -14,8 +14,22 @@
|
||||||
<meta name="robots" content="noindex, nofollow, noarchive, noimageindex">
|
<meta name="robots" content="noindex, nofollow, noarchive, noimageindex">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}">
|
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}">
|
||||||
{{- with .Site.Params.author }}
|
{{- $authorName := "" }}
|
||||||
<meta name="author" content="{{ . }}">
|
{{- if .Site.Params.author }}
|
||||||
|
{{- if reflect.IsMap .Site.Params.author }}
|
||||||
|
{{- with .Site.Params.author.name }}
|
||||||
|
{{- $authorName = . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
{{- warnf "According to Hugo 0.120.0 the author key in params configuration should now be a map and contain of name and email fields." }}
|
||||||
|
{{- $authorName = .Site.Params.author }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
{{- with .Site.Author.name }}
|
||||||
|
{{- $authorName = . }}
|
||||||
|
{{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
<meta name="author" content="{{ $authorName }}">
|
||||||
{{- partial "twitter_cards.html" . }}
|
{{- partial "twitter_cards.html" . }}
|
||||||
{{- partial "opengraph.html" . }}
|
{{- partial "opengraph.html" . }}
|
|
@ -107,7 +107,19 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}}
|
||||||
|
{{- $facebookAdmin := "" }}
|
||||||
|
{{- with site.Params.social.facebook_admin }}
|
||||||
|
{{- $facebookAdmin = . }}
|
||||||
|
{{- else }}
|
||||||
|
{{- with site.Social.facebook_admin }}
|
||||||
|
{{- $facebookAdmin = . }}
|
||||||
|
{{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- /* Facebook Page Admin ID for Domain Insights */}}
|
{{- /* Facebook Page Admin ID for Domain Insights */}}
|
||||||
{{- with .Site.Social.facebook_admin }}
|
{{- with $facebookAdmin }}
|
||||||
<meta property="fb:admins" content="{{ . }}">
|
<meta property="fb:admins" content="{{ . }}">
|
||||||
{{- end }}
|
{{- end }}
|
|
@ -43,6 +43,18 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<meta name="twitter:title" content="{{ $title }}">
|
<meta name="twitter:title" content="{{ $title }}">
|
||||||
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
|
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
|
||||||
{{- with .Site.Social.twitter }}
|
|
||||||
|
{{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}}
|
||||||
|
{{- $twitterSite := "" }}
|
||||||
|
{{- with site.Params.social.twitter }}
|
||||||
|
{{- $twitterSite = . }}
|
||||||
|
{{- else }}
|
||||||
|
{{- with site.Social.twitter }}
|
||||||
|
{{- $twitterSite = . }}
|
||||||
|
{{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- with $twitterSite }}
|
||||||
<meta name="twitter:site" content="@{{ . }}">
|
<meta name="twitter:site" content="@{{ . }}">
|
||||||
{{- end }}
|
{{- end }}
|
Loading…
Reference in a new issue