feat(search): improve search index

This commit is contained in:
Dillon
2020-04-30 02:44:07 +08:00
parent f62ccbf6b5
commit 108679e137

View File

@@ -18,7 +18,7 @@
{{- if gt $i 0 -}} {{- if gt $i 0 -}}
{{- $chunked = printf "<h2 id=%s" $chunked -}} {{- $chunked = printf "<h2 id=%s" $chunked -}}
{{- end -}} {{- end -}}
{{- $chunked = $chunked | plainify | htmlUnescape | replaceRE `[\n ]+` ` ` -}} {{- $chunked = $chunked | plainify | htmlUnescape | replace "\n" " " | replace "\t" " " | replaceRE " +" " " -}}
{{- if gt $.Site.Params.search.contentLength 0 -}} {{- if gt $.Site.Params.search.contentLength 0 -}}
{{- $chunked = substr $chunked 0 $.Site.Params.search.contentLength -}} {{- $chunked = substr $chunked 0 $.Site.Params.search.contentLength -}}
{{- end -}} {{- end -}}