From 434396b612215454f6c193b09523505f8c65f4ce 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 c10a58b..da99b54 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 29aaef3..ac31d72 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" }}