2020-02-11 12:26:28 +00:00
|
|
|
{{ .Scratch.Delete "searchindex" }}
|
2020-02-06 02:18:23 +00:00
|
|
|
{{- $.Scratch.Add "searchindex" slice -}}
|
|
|
|
|
|
|
|
{{ if eq .Type "publication" }}
|
|
|
|
|
|
|
|
{{ if eq .Permalink .FirstSection.Permalink }}
|
|
|
|
{{- range $index, $element := (where .Site.RegularPages "Section" "publication") -}}
|
|
|
|
{{- $.Scratch.Add "searchindex" (dict "id" $index "title" $element.Title "shorttitle" $element.Params.shorttitle "booktitle" $element.Params.booktitle "uri" $element.Permalink "tags" $element.Params.tags "authors" $element.Params.authors "abstract" $element.Params.abstract "ENTRYTYPE" $element.Params.ENTRYTYPE "publication" $element.Params.publication "publishDate" $element.Params.publishDate) -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{ else }}
|
2020-02-08 09:54:54 +00:00
|
|
|
{{ $paginator := .Paginate (where .Pages "Type" .Type) ($.Param "pubPaginate") }}
|
2020-02-06 02:18:23 +00:00
|
|
|
{{- range $index, $element := $paginator.Pages -}}
|
2020-02-08 19:36:51 +00:00
|
|
|
{{- $.Scratch.Add "searchindex" (dict "id" $index "title" $element.Title "shorttitle" $element.Params.shorttitle "booktitle" $element.Params.booktitle "uri" $element.Permalink "tags" $element.Params.tags "authors" $element.Params.authors "abstract" $element.Params.abstract "ENTRYTYPE" $element.Params.ENTRYTYPE "publication" $element.Params.publication "publishDate" $element.Params.publishDate "tags" $element.Params.tags) -}}
|
2020-02-06 02:18:23 +00:00
|
|
|
{{- end -}}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ else }}
|
|
|
|
|
2020-02-06 16:19:25 +00:00
|
|
|
{{- range $index, $element := (where .Site.RegularPages "Kind" "page") -}}
|
2020-02-06 02:18:23 +00:00
|
|
|
{{ with $element.Plain }}
|
|
|
|
{{- $.Scratch.Add "searchindex" (dict "id" $index "title" $element.Title "uri" $element.Permalink "tags" $element.Params.tags "section" $element.Section "content" $element.Plain "description" $element.Description) -}}
|
|
|
|
{{ end }}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{- $.Scratch.Get "searchindex" | jsonify -}}
|