fix: search index content htmlEscape

This commit is contained in:
Dillon
2020-04-28 13:01:11 +08:00
parent a869ce295a
commit 2ccba79cba

View File

@@ -11,7 +11,7 @@
{{- $one = delimit $tags "\n" | dict "tags" | merge $one -}} {{- $one = delimit $tags "\n" | dict "tags" | merge $one -}}
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormat | default "2006-01-02") -}} {{- $publish_date := .PublishDate.Format (.Site.Params.dateFormat | default "2006-01-02") -}}
{{- $one = dict "date" $publish_date | merge $one -}} {{- $one = dict "date" $publish_date | merge $one -}}
{{- $content := .RawContent -}} {{- $content := .RawContent | htmlEscape -}}
{{- if gt .Site.Params.search.contentLength 0 -}} {{- if gt .Site.Params.search.contentLength 0 -}}
{{- $content = substr $content 0 .Site.Params.search.contentLength -}} {{- $content = substr $content 0 .Site.Params.search.contentLength -}}
{{- end -}} {{- end -}}