Add .Summary as fallback for description
This commit is contained in:
parent
b1227d78cc
commit
434396b612
|
@ -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 -}}
|
||||
|
|
|
@ -18,9 +18,13 @@
|
|||
|
||||
{{ with .Description -}}
|
||||
<meta name="description" content="{{ . }}">
|
||||
{{ else -}}
|
||||
{{ with .Summary | plainify -}}
|
||||
<meta name="description" content="{{ . }}">
|
||||
{{ else -}}
|
||||
<meta name="description" content="{{ .Site.Params.description }}">
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ if $.Scratch.Get "paginator" }}
|
||||
<link rel="canonical" href="{{ .Paginator.URL | absURL }}">
|
||||
|
|
Loading…
Reference in New Issue