Fix invalid json when page has no content or description.
This commit is contained in:
parent
dc538ae451
commit
1bd584da5f
1 changed files with 3 additions and 1 deletions
|
|
@ -7,7 +7,9 @@
|
|||
"datePublished": {{ .Date.Format "2006-01-02T15:04:05Z07:00" }},
|
||||
"dateModified": {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }},
|
||||
"url" : {{ .Permalink }},
|
||||
"description": {{ with (.Description | default (replaceRE "\n" " " (.Plain | truncate 170))) }}{{ . }}{{ end }},
|
||||
{{ with (.Description | default (replaceRE "\n" " " (.Plain | truncate 170))) -}}
|
||||
"description": {{ . }},
|
||||
{{ end -}}
|
||||
{{ with .Params.tags -}}
|
||||
"keywords": {{ . }},
|
||||
{{ end -}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue