Skip to content

Commit

Permalink
Merge pull request thuliteio#508 from schnerring/flexsearch-description
Browse files Browse the repository at this point in the history
Add .Summary as fallback for description
  • Loading branch information
h-enk committed Oct 14, 2021
2 parents e74d4a3 + 1552001 commit 47efb71
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 @@ -103,7 +103,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 47efb71

Please sign in to comment.