diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 2d95400f65..63cd432b87 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -21,8 +21,7 @@ {{ .Site.Title -}} {{ end -}} -{{ $desc := .Page.Description | default (.Page.Content | safeHTML | truncate 150) -}} - + {{ template "_internal/opengraph.html" . -}} {{ template "_internal/schema.html" . -}} {{ template "_internal/twitter_cards.html" . -}} diff --git a/layouts/partials/page-description.html b/layouts/partials/page-description.html new file mode 100644 index 0000000000..3529fbe611 --- /dev/null +++ b/layouts/partials/page-description.html @@ -0,0 +1,11 @@ +{{ with .Description | plainify -}} + {{ . -}} +{{ else -}} + {{ if .IsPage -}} + {{ .Summary | plainify | chomp -}} + {{ else -}} + {{ with .Site.Params.description | plainify -}} + {{ . -}} + {{ end -}} + {{ end -}} +{{ end -}}