mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
theme: unify description #845
This commit is contained in:
parent
ebe1dd13fe
commit
82f946618c
7 changed files with 18 additions and 18 deletions
|
@ -42,7 +42,13 @@ This document shows you what's new in the latest release and flags it with one o
|
||||||
|
|
||||||
You may experience slight changes for some icons. In addition you have additional ~1700 icons [to chose](https://fontawesome.com/v6/search?m=free) from.
|
You may experience slight changes for some icons. In addition you have additional ~1700 icons [to chose](https://fontawesome.com/v6/search?m=free) from.
|
||||||
|
|
||||||
- {{% badge style="note" title=" " %}}Change{{% /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="note" title=" " %}}Change{{% /badge %}} The [`children` shortcode](shortcodes/children) was fixed to adhere to its documentation generating the description based on this rule: When no description or summary exists for the page, the first 70 words of the content is taken.
|
||||||
|
|
||||||
|
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).
|
- {{% 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" .Description
|
"description" (or .Description .Summary site.Params.Description)
|
||||||
"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" .Description
|
"description" (or .Description .Summary site.Params.Description)
|
||||||
"content" (.Plain | htmlUnescape)
|
"content" (.Plain | htmlUnescape)
|
||||||
) }}
|
) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -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 .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}">
|
<meta name="description" content="{{ with or .Description .Summary site.Params.Description }}{{ . }}{{ 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 site.Params.Description | plainify }}
|
||||||
<meta property="og:description" content="{{ . }}">
|
<meta property="og:description" content="{{ . }}">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
|
|
@ -37,30 +37,24 @@
|
||||||
{{- $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 }}
|
||||||
{{- if .Description -}}
|
{{- with or .Description .Summary site.Params.Description -}}
|
||||||
<p>{{ .Description }}</p>
|
<p>{{ . }}</p>
|
||||||
{{- else -}}
|
|
||||||
<p>{{ .Summary }}</p>
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- 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 }}
|
||||||
{{- if .Description -}}
|
{{- with or .Description .Summary site.Params.Description -}}
|
||||||
<p>{{ .Description }}</p>
|
<p>{{ . }}</p>
|
||||||
{{- else -}}
|
|
||||||
<p>{{ .Summary }}</p>
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- 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 }}
|
||||||
{{- if .Description -}}
|
{{- with or .Description .Summary site.Params.Description -}}
|
||||||
<p>{{ .Description }}</p>
|
<p>{{ . }}</p>
|
||||||
{{- else -}}
|
|
||||||
<p>{{ .Summary }}</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 .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
|
<meta name="twitter:description" content="{{ with or .Description .Summary site.Params.Description }}{{ . }}{{ end }}">
|
||||||
|
|
||||||
{{- $twitterSite := "" }}
|
{{- $twitterSite := "" }}
|
||||||
{{- with site.Params.social }}
|
{{- with site.Params.social }}
|
||||||
|
|
Loading…
Reference in a new issue