diff --git a/exampleSite/config/_default/hugo.toml b/exampleSite/config/_default/hugo.toml index de6cfad3ca..855a2ceee8 100644 --- a/exampleSite/config/_default/hugo.toml +++ b/exampleSite/config/_default/hugo.toml @@ -29,7 +29,7 @@ defaultContentLanguage = "en" title = "Hugo Relearn Theme" # Don't use any auto-generated summaries -summaryLength = 0 +summaryLength = 10 [outputs] # add `json` to the home to support Lunr search; This is a mandatory setting diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index 82770c4128..f80705ad3f 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -19,13 +19,6 @@ author.name = "Sören Weber" # This can be overridden in the page's frontmatter. 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. # Default: not set # Configuration for the Open Graph protocol and Twitter Cards adhere to Hugo's diff --git a/exampleSite/content/basics/migration/_index.en.md b/exampleSite/content/basics/migration/_index.en.md index fea8fdddc2..649b34d6af 100644 --- a/exampleSite/content/basics/migration/_index.en.md +++ b/exampleSite/content/basics/migration/_index.en.md @@ -32,6 +32,12 @@ This document shows you what's new in the latest release and flags it with one o --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`. 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. - 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 %}} Math is now usable without enclosing it in a shortcode or codefence by using Hugo's [passthrough configuration](shortcodes/math#passthrough-configuration). diff --git a/layouts/_default/index.json b/layouts/_default/index.json index 620267ec1f..652ee6f999 100644 --- a/layouts/_default/index.json +++ b/layouts/_default/index.json @@ -7,7 +7,7 @@ "title" (partial "pageHelper/title.hugo" (dict "page" .)) "tags" .Params.tags "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) ) }} {{- end }} diff --git a/layouts/_default/index.search.js b/layouts/_default/index.search.js index 3b30653062..f37a740ab1 100644 --- a/layouts/_default/index.search.js +++ b/layouts/_default/index.search.js @@ -7,7 +7,7 @@ "title" (partial "pageHelper/title.hugo" (dict "page" .)) "tags" .Params.tags "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) ) }} {{- end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index feb0f0592e..8556486454 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -11,6 +11,9 @@ {{- errorf "The Relearn theme requires Hugo %s or later" $hugoVersion }} {{- 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 }}
{{- partial "meta.html" . }} diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index a45fe46781..acd3055a64 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -13,7 +13,7 @@ {{- if not (and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) ) }} {{- end }} - + {{- $authorName := partialCached "authorname.hugo" . }} {{- partial "twitter_cards.html" . }} diff --git a/layouts/partials/opengraph.html b/layouts/partials/opengraph.html index 6f8e314830..b297239b7c 100644 --- a/layouts/partials/opengraph.html +++ b/layouts/partials/opengraph.html @@ -12,7 +12,7 @@ {{- end }} -{{- with or .Description .Summary site.Params.Description | plainify }} +{{- with or .Description .Summary | plainify }} {{- end }} diff --git a/layouts/partials/schema.html b/layouts/partials/schema.html index 541fad0210..d2f4a4e438 100644 --- a/layouts/partials/schema.html +++ b/layouts/partials/schema.html @@ -3,7 +3,7 @@ {{- end }} -{{- with or .Description .Summary site.Params.Description }} +{{- with or .Description .Summary }} {{- end }} diff --git a/layouts/partials/shortcodes/children.html b/layouts/partials/shortcodes/children.html index c4af90fff3..bd005fa9d4 100644 --- a/layouts/partials/shortcodes/children.html +++ b/layouts/partials/shortcodes/children.html @@ -37,7 +37,7 @@ {{- $numn := add $num $.count }} {{ (printf "{{ . }}
{{- end }} {{- end }} @@ -45,7 +45,7 @@ {{- else if eq $.style "li" }} {{ (printf "<%s>" $.style)|safeHTML }}{{ if .RelPermalink }}{{ .Title }}{{ else }}{{ .Title }}{{ end }} {{- if $.description }} - {{- with or .Description .Summary site.Params.Description -}} + {{- with or .Description .Summary -}}{{ . }}
{{- end }} {{- end }} @@ -53,7 +53,7 @@ {{- else }} {{ (printf "<%s>" $.style)|safeHTML }}{{ if .RelPermalink }}{{ .Title }}{{ else }}{{ .Title }}{{ end }}{{ (printf "%s>" $.style)|safeHTML }} {{- if $.description }} - {{- with or .Description .Summary site.Params.Description -}} + {{- with or .Description .Summary -}}{{ . }}
{{- end }} {{- end }} diff --git a/layouts/partials/twitter_cards.html b/layouts/partials/twitter_cards.html index ae16d706b7..fd4c6f9fbb 100644 --- a/layouts/partials/twitter_cards.html +++ b/layouts/partials/twitter_cards.html @@ -7,7 +7,7 @@ {{- end }} - + {{- $twitterSite := "" }} {{- with site.Params.social }}