mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 15:57:57 +00:00
theme: unsupport description in hugo.toml #845
This commit is contained in:
parent
bc13ade3e1
commit
79b42f95a8
11 changed files with 19 additions and 19 deletions
|
@ -29,7 +29,7 @@ defaultContentLanguage = "en"
|
||||||
title = "Hugo Relearn Theme"
|
title = "Hugo Relearn Theme"
|
||||||
|
|
||||||
# Don't use any auto-generated summaries
|
# Don't use any auto-generated summaries
|
||||||
summaryLength = 0
|
summaryLength = 10
|
||||||
|
|
||||||
[outputs]
|
[outputs]
|
||||||
# add `json` to the home to support Lunr search; This is a mandatory setting
|
# add `json` to the home to support Lunr search; This is a mandatory setting
|
||||||
|
|
|
@ -19,13 +19,6 @@ author.name = "Sören Weber"
|
||||||
# This can be overridden in the page's frontmatter.
|
# This can be overridden in the page's frontmatter.
|
||||||
images = [ "images/hero.png" ]
|
images = [ "images/hero.png" ]
|
||||||
|
|
||||||
# The description of your site.
|
|
||||||
# Default: not set
|
|
||||||
# This is used for generating HTML meta tags, social media meta information
|
|
||||||
# for the opengraph protocol and twitter cards.
|
|
||||||
# This can be overridden in the page's frontmatter.
|
|
||||||
description = "Documentation for Hugo Relearn Theme"
|
|
||||||
|
|
||||||
# Admin options for social media.
|
# Admin options for social media.
|
||||||
# Default: not set
|
# Default: not set
|
||||||
# Configuration for the Open Graph protocol and Twitter Cards adhere to Hugo's
|
# Configuration for the Open Graph protocol and Twitter Cards adhere to Hugo's
|
||||||
|
|
|
@ -32,6 +32,12 @@ This document shows you what's new in the latest release and flags it with one o
|
||||||
--CODE-theme: monokai;
|
--CODE-theme: monokai;
|
||||||
````
|
````
|
||||||
|
|
||||||
|
- {{% badge style="warning" title=" " %}}Breaking{{% /badge %}} The parameter `description` in your `hugo.toml` will now been ignored.
|
||||||
|
|
||||||
|
With the newly introduces unified handling of descriptions throughout the theme, the only place the old parameter would have been used was your home page.
|
||||||
|
|
||||||
|
For migration, move the `description` parameter of your `hugo.toml` into the frontmatter section of your home page.
|
||||||
|
|
||||||
- {{% badge style="warning" title=" " %}}Breaking{{% /badge %}} The frontmatter option `menuTitle` is now unsupported in favor for Hugo’s own `linkTitle`.
|
- {{% badge style="warning" title=" " %}}Breaking{{% /badge %}} The frontmatter option `menuTitle` is now unsupported in favor for Hugo’s own `linkTitle`.
|
||||||
|
|
||||||
Additionally, if set `linkTitle` will now be used instead of `title` to generate the breadcrumb.
|
Additionally, if set `linkTitle` will now be used instead of `title` to generate the breadcrumb.
|
||||||
|
@ -46,8 +52,6 @@ This document shows you what's new in the latest release and flags it with one o
|
||||||
|
|
||||||
Previously, the summary erroneously was ignored which now can lead to different output if you set `description=true` as a parameter.
|
Previously, the summary erroneously was ignored which now can lead to different output if you set `description=true` as a parameter.
|
||||||
|
|
||||||
In addition, all places where descriptions are printed, now behave in the same way.
|
|
||||||
|
|
||||||
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} The [`include` shortcode](shortcodes/include) is now able to resolve links to resources as well as to files in the file system (the old behavior). You can configure to generate warnings or errors during build by setting `include.errorlevel` to either `warning` or `error` in your `hugo.toml` if a path can not be resolved.
|
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} The [`include` shortcode](shortcodes/include) is now able to resolve links to resources as well as to files in the file system (the old behavior). You can configure to generate warnings or errors during build by setting `include.errorlevel` to either `warning` or `error` in your `hugo.toml` if a path can not be resolved.
|
||||||
|
|
||||||
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Math is now usable without enclosing it in a shortcode or codefence by using Hugo's [passthrough configuration](shortcodes/math#passthrough-configuration).
|
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Math is now usable without enclosing it in a shortcode or codefence by using Hugo's [passthrough configuration](shortcodes/math#passthrough-configuration).
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"title" (partial "pageHelper/title.hugo" (dict "page" .))
|
"title" (partial "pageHelper/title.hugo" (dict "page" .))
|
||||||
"tags" .Params.tags
|
"tags" .Params.tags
|
||||||
"breadcrumb" (trim ((partial "breadcrumbs.html" (dict "page" . "dirOnly" true)) | plainify | htmlUnescape) "\n\r\t ")
|
"breadcrumb" (trim ((partial "breadcrumbs.html" (dict "page" . "dirOnly" true)) | plainify | htmlUnescape) "\n\r\t ")
|
||||||
"description" (or .Description .Summary site.Params.Description)
|
"description" (or .Description .Summary)
|
||||||
"content" (.Plain | htmlUnescape)
|
"content" (.Plain | htmlUnescape)
|
||||||
) }}
|
) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"title" (partial "pageHelper/title.hugo" (dict "page" .))
|
"title" (partial "pageHelper/title.hugo" (dict "page" .))
|
||||||
"tags" .Params.tags
|
"tags" .Params.tags
|
||||||
"breadcrumb" (trim ((partial "breadcrumbs.html" (dict "page" . "dirOnly" true)) | plainify | htmlUnescape) "\n\r\t ")
|
"breadcrumb" (trim ((partial "breadcrumbs.html" (dict "page" . "dirOnly" true)) | plainify | htmlUnescape) "\n\r\t ")
|
||||||
"description" (or .Description .Summary site.Params.Description)
|
"description" (or .Description .Summary)
|
||||||
"content" (.Plain | htmlUnescape)
|
"content" (.Plain | htmlUnescape)
|
||||||
) }}
|
) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -11,6 +11,9 @@
|
||||||
{{- errorf "The Relearn theme requires Hugo %s or later" $hugoVersion }}
|
{{- errorf "The Relearn theme requires Hugo %s or later" $hugoVersion }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .Site.Params.description }}
|
||||||
|
{{- warnf "UNSUPPORTED usage of 'params.description' config parameter found, move it to the frontmatter of your home page; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#600" }}
|
||||||
|
{{- end }}
|
||||||
<html lang="{{ .Page.Language.LanguageCode | default "en" }}" dir="{{ .Page.Language.LanguageDirection | default (T "Reading-direction") | default "ltr" }}">
|
<html lang="{{ .Page.Language.LanguageCode | default "en" }}" dir="{{ .Page.Language.LanguageDirection | default (T "Reading-direction") | default "ltr" }}">
|
||||||
<head>
|
<head>
|
||||||
{{- partial "meta.html" . }}
|
{{- partial "meta.html" . }}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
{{- if not (and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) ) }}
|
{{- if not (and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) ) }}
|
||||||
<meta name="robots" content="noindex, nofollow, noarchive, noimageindex">
|
<meta name="robots" content="noindex, nofollow, noarchive, noimageindex">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<meta name="description" content="{{ with or .Description .Summary site.Params.Description }}{{ . }}{{ end }}">
|
<meta name="description" content="{{ with or .Description .Summary }}{{ . }}{{ end }}">
|
||||||
{{- $authorName := partialCached "authorname.hugo" . }}
|
{{- $authorName := partialCached "authorname.hugo" . }}
|
||||||
<meta name="author" content="{{ $authorName }}">
|
<meta name="author" content="{{ $authorName }}">
|
||||||
{{- partial "twitter_cards.html" . }}
|
{{- partial "twitter_cards.html" . }}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<meta property="og:title" content="{{ partial "pageHelper/title.hugo" (dict "page" . "fullyQualified" true "reverse" true "format" $format "outputFormat" $outputFormat) | plainify }}">
|
<meta property="og:title" content="{{ partial "pageHelper/title.hugo" (dict "page" . "fullyQualified" true "reverse" true "format" $format "outputFormat" $outputFormat) | plainify }}">
|
||||||
|
|
||||||
{{- with or .Description .Summary site.Params.Description | plainify }}
|
{{- with or .Description .Summary | plainify }}
|
||||||
<meta property="og:description" content="{{ . }}">
|
<meta property="og:description" content="{{ . }}">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<meta itemprop="name" content="{{ . }}">
|
<meta itemprop="name" content="{{ . }}">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- with or .Description .Summary site.Params.Description }}
|
{{- with or .Description .Summary }}
|
||||||
<meta itemprop="description" content="{{ . }}">
|
<meta itemprop="description" content="{{ . }}">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
{{- $numn := add $num $.count }}
|
{{- $numn := add $num $.count }}
|
||||||
{{ (printf "<h%d>" $numn)|safeHTML }}{{ if .RelPermalink }}<a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">{{ .Title }}</a>{{ else }}<span>{{ .Title }}</span>{{ end }}{{ (printf "</h%d>" $numn)|safeHTML }}
|
{{ (printf "<h%d>" $numn)|safeHTML }}{{ if .RelPermalink }}<a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">{{ .Title }}</a>{{ else }}<span>{{ .Title }}</span>{{ end }}{{ (printf "</h%d>" $numn)|safeHTML }}
|
||||||
{{- if $.description }}
|
{{- if $.description }}
|
||||||
{{- with or .Description .Summary site.Params.Description -}}
|
{{- with or .Description .Summary -}}
|
||||||
<p>{{ . }}</p>
|
<p>{{ . }}</p>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
{{- else if eq $.style "li" }}
|
{{- else if eq $.style "li" }}
|
||||||
{{ (printf "<%s>" $.style)|safeHTML }}{{ if .RelPermalink }}<a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">{{ .Title }}</a>{{ else }}<span>{{ .Title }}</span>{{ end }}
|
{{ (printf "<%s>" $.style)|safeHTML }}{{ if .RelPermalink }}<a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">{{ .Title }}</a>{{ else }}<span>{{ .Title }}</span>{{ end }}
|
||||||
{{- if $.description }}
|
{{- if $.description }}
|
||||||
{{- with or .Description .Summary site.Params.Description -}}
|
{{- with or .Description .Summary -}}
|
||||||
<p>{{ . }}</p>
|
<p>{{ . }}</p>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{ (printf "<%s>" $.style)|safeHTML }}{{ if .RelPermalink }}<a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">{{ .Title }}</a>{{ else }}<span>{{ .Title }}</span>{{ end }}{{ (printf "</%s>" $.style)|safeHTML }}
|
{{ (printf "<%s>" $.style)|safeHTML }}{{ if .RelPermalink }}<a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">{{ .Title }}</a>{{ else }}<span>{{ .Title }}</span>{{ end }}{{ (printf "</%s>" $.style)|safeHTML }}
|
||||||
{{- if $.description }}
|
{{- if $.description }}
|
||||||
{{- with or .Description .Summary site.Params.Description -}}
|
{{- with or .Description .Summary -}}
|
||||||
<p>{{ . }}</p>
|
<p>{{ . }}</p>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<meta name="twitter:card" content="summary">
|
<meta name="twitter:card" content="summary">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<meta name="twitter:title" content="{{ partial "pageHelper/title.hugo" (dict "page" . "fullyQualified" true "reverse" true) }}">
|
<meta name="twitter:title" content="{{ partial "pageHelper/title.hugo" (dict "page" . "fullyQualified" true "reverse" true) }}">
|
||||||
<meta name="twitter:description" content="{{ with or .Description .Summary site.Params.Description }}{{ . }}{{ end }}">
|
<meta name="twitter:description" content="{{ with or .Description .Summary }}{{ . }}{{ end }}">
|
||||||
|
|
||||||
{{- $twitterSite := "" }}
|
{{- $twitterSite := "" }}
|
||||||
{{- with site.Params.social }}
|
{{- with site.Params.social }}
|
||||||
|
|
Loading…
Reference in a new issue