Fixed empty string parse error in meta_json_id.html

Hugo throws error while building if I do not give any description. Because the description were becoming only `"description": ,` which is invalid. FIxed it by wraping which will give `"description": "",` which is valid.
This commit is contained in:
Rahat Zaman 2020-06-30 12:31:29 +06:00
parent 2175f01297
commit 6af870a034
1 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@
"datePublished": {{ .Date.Format "2006-01-02T15:04:05Z07:00" }}, "datePublished": {{ .Date.Format "2006-01-02T15:04:05Z07:00" }},
"dateModified": {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}, "dateModified": {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }},
"url" : {{ .Permalink }}, "url" : {{ .Permalink }},
"description": {{ with (.Description | default (replaceRE "\n" " " (.Summary | truncate 170))) }}{{ . }}{{ end }}, "description": "{{ with (.Description | default (replaceRE "\n" " " (.Summary | truncate 170))) }}{{ . }}{{ end }}",
{{ with .Params.tags -}} {{ with .Params.tags -}}
"keywords": {{ . }}, "keywords": {{ . }},
{{ end -}} {{ end -}}
@ -16,7 +16,7 @@
"url" : {{ .Permalink }}, "url" : {{ .Permalink }},
"name": {{ .Title }}, "name": {{ .Title }},
{{ with $.Param "description" -}} {{ with $.Param "description" -}}
"description": {{ . }}, "description": "{{ . }}",
{{ end -}} {{ end -}}
{{ end -}} {{ end -}}
{{ with $.Param "image" -}} {{ with $.Param "image" -}}