mirror of
https://github.com/fruworg/themu.git
synced 2024-11-16 07:07:16 +03:00
Improve meta description
Rather than use the same description on every page, prefer the post summary if it's available and only use .Params.description on the root page. This mimics the behavior of the [opengraph internal template](https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/opengraph.html#L2) for the `og:description` tag.
This commit is contained in:
parent
1f47eeb7be
commit
117808b653
@ -14,9 +14,7 @@
|
||||
{{- end -}}
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
{{- if isset .Site.Params "description" }}
|
||||
<meta name="description" content="{{ .Site.Params.description }}" />
|
||||
{{- end }}
|
||||
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
|
||||
<meta property="og:image" content="{{ .Site.Params.og_image }}"/>
|
||||
{{ with .OutputFormats.Get "rss" -}}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
||||
|
Loading…
Reference in New Issue
Block a user