1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-19 18:45:30 -04:00

Generate index of content for Algolia search (#50)

This commit is contained in:
2020-03-03 15:41:15 -05:00
committed by GitHub
parent 4b1b2401f8
commit a48c16d65c
4 changed files with 1846 additions and 32 deletions

View File

@@ -0,0 +1,8 @@
{{- $.Scratch.Add "index" slice -}}
{{- $section := $.Site.GetPage "section" .Section }}
{{- range .Site.AllPages -}}
{{- if or (and (.IsDescendant $section) (and (not .Draft) (not .Params.private))) $section.IsHome -}}
{{- $.Scratch.Add "index" (dict "objectID" .File.UniqueID "date" .Date.UTC.Unix "description" .Description "kind" .Kind "lang" .Lang "lastmod" .Lastmod.UTC.Unix "permalink" .Permalink "publishdate" .PublishDate "readingtime" .ReadingTime "summary" .Summary "title" .Title "type" .Type "url" .RelPermalink "weight" .Weight "wordcount" .WordCount "section" .Section "tags" .Params.Tags "authors" $.Site.Author.name)}}
{{- end -}}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}