Skip to content

Commit

Permalink
Add .Summary as fallback for description
Browse files Browse the repository at this point in the history
  • Loading branch information
schnerring committed Oct 13, 2021
1 parent b1227d7 commit 434396b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
6 changes: 5 additions & 1 deletion layouts/partials/head/seo.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
{{ with .Description -}}
<meta name="description" content="{{ . }}">
{{ else -}}
<meta name="description" content="{{ .Site.Params.description }}">
{{ with .Summary | plainify -}}
<meta name="description" content="{{ . }}">
{{ else -}}
<meta name="description" content="{{ .Site.Params.description }}">
{{ end -}}
{{ end -}}

{{ if $.Scratch.Get "paginator" }}
Expand Down

0 comments on commit 434396b

Please sign in to comment.