mirror of
https://gitlab.com/octtspacc/sitoctt
synced 2025-06-05 22:09:20 +02:00
Aggiunta ricerca (fork da https://github.com/nunocoracao/blowfish), bottoni ordinati, bottone torna in cima
This commit is contained in:
28
layouts/index.searchindex.js
Normal file
28
layouts/index.searchindex.js
Normal 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 -}}
|
Reference in New Issue
Block a user