From 117808b653817e8ff7c7fc747361d2227de07a82 Mon Sep 17 00:00:00 2001 From: David Wittman Date: Sat, 22 May 2021 10:54:55 -0500 Subject: [PATCH] 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. --- layouts/partials/header.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/layouts/partials/header.html b/layouts/partials/header.html index c594dfb..14b1248 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -14,9 +14,7 @@ {{- end -}} - {{- if isset .Site.Params "description" }} - - {{- end }} + {{ with .OutputFormats.Get "rss" -}} {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}