Improve description wrapping in <head> metadata

This commit is contained in:
2021-11-13 19:37:50 -06:00
parent 240476061b
commit 179eda3450
4 changed files with 55 additions and 4 deletions

View File

@ -1,6 +1,6 @@
<!-- See https://github.com/BBaoVanC/hugo/blob/opengraph-video-resources/tpl/tplimpl/embedded/templates/opengraph.html -->
<!-- See https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/opengraph.html -->
<meta property="og:title" content="{{ .Title }}" />
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary | plainify }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" />