Aggiunta ricerca (fork da https://github.com/nunocoracao/blowfish), bottoni ordinati, bottone torna in cima

This commit is contained in:
2024-08-30 01:18:35 +02:00
parent 13899491d9
commit 745267cf49
20 changed files with 541 additions and 157 deletions

View File

@@ -0,0 +1,28 @@
{{- $index := slice -}}
{{- $pages := .Site.Pages -}}
{{- range $pages -}}
{{- $section := .Site.GetPage "section" .Section -}}
{{- if .Date -}}
{{- $index = $index | append (dict
"date" (.Date | time.Format (.Site.Language.Params.dateFormat | default ":date_long"))
"title" (.Title | emojify | safeJS)
"section" ($section.Title | emojify | safeJS)
"summary" (.Summary | safeJS)
"content" (.Plain | safeJS)
"permalink" .RelPermalink
"externalUrl" .Params.externalUrl
"type" .Type
) -}}
{{- else -}}
{{- $index = $index | append (dict
"title" (.Title | emojify | safeJS)
"section" ($section.Title | emojify | safeJS)
"summary" (.Summary | safeJS)
"content" (.Plain | safeJS)
"permalink" .RelPermalink
"externalUrl" .Params.externalUrl
"type" .Type
) -}}
{{- end -}}
{{- end -}}
window.SiteSearchIndex={{- $index | jsonify -}}