From 1552001a48eb9ccbf8859294f6e641ca4a94d801 Mon Sep 17 00:00:00 2001 From: Michael Schnerring <3743342+schnerring@users.noreply.github.com> Date: Wed, 13 Oct 2021 17:17:28 +0200 Subject: [PATCH] Add .Summary as fallback for description --- assets/js/index.js | 6 +++++- layouts/partials/head/seo.html | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/assets/js/index.js b/assets/js/index.js index c10a58b5a..da99b54b8 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -104,7 +104,11 @@ Source: id: {{ $index }}, href: "{{ .RelPermalink }}", title: {{ .Title | jsonify }}, - description: {{ .Params.description | jsonify }}, + {{ with .Description -}} + description: {{ . | jsonify }}, + {{ else -}} + description: {{ .Summary | plainify | jsonify }}, + {{ end -}} content: {{ .Content | jsonify }} }) {{ if ne (add $index 1) $len -}} diff --git a/layouts/partials/head/seo.html b/layouts/partials/head/seo.html index 29aaef369..ac31d7299 100644 --- a/layouts/partials/head/seo.html +++ b/layouts/partials/head/seo.html @@ -19,7 +19,11 @@ {{ with .Description -}} {{ else -}} - + {{ with .Summary | plainify -}} + + {{ else -}} + + {{ end -}} {{ end -}} {{ if $.Scratch.Get "paginator" }}