diff --git a/config/_default/config.toml b/config/_default/config.toml index 54bbf5dce13..cd901ee95cf 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -33,12 +33,13 @@ home = [ "HTML", "Algolia", "Content"] baseName = "algolia" isPlainText = true mediaType = "application/json" +notAlternative = true [outputFormats.Content] baseName = "content" isPlainText = true mediaType = "application/json" -notAlternative = true + [params.algolia] vars = ["title", "summary", "date", "publishdate", "expirydate", "permalink"] diff --git a/layouts/_default/list.algolia.json b/layouts/_default/list.algolia.json index 7237f16fcdc..3b83338ea81 100644 --- a/layouts/_default/list.algolia.json +++ b/layouts/_default/list.algolia.json @@ -1,34 +1,32 @@ {{/* Generates a valid Algolia search index */}} -{{- $.Scratch.Add "index" slice -}} -{{- $section := $.Site.GetPage "section" .Section }} +{{- $.Scratch.Add "algolia_index" slice -}} {{- range .Site.AllPages -}} - {{- if or (and (.IsDescendant $section) (and (not .Draft) (not .Params.private))) $section.IsHome -}} + {{- if and (not .Draft) (not .Params.private) -}} {{- if .File -}} - {{- $.Scratch.Add "index" (dict "objectID" .File.UniqueID - "date" .Date.UTC.Unix - "description" .Description - "dir" .File.Dir - "expirydate" .ExpiryDate.UTC.Unix - "fuzzywordcount" .FuzzyWordCount - "keywords" .Keywords - "kind" .Kind - "lang" .Lang - "lastmod" .Lastmod.UTC.Unix - "permalink" .Permalink - "publishdate" .PublishDate - "readingtime" .ReadingTime - "relpermalink" .RelPermalink - "summary" .Summary - "title" .Title - "type" .Type - "url" .RelPermalink - "weight" .Weight - "wordcount" .WordCount - "section" .Section - "tags" .Params.Tags - "categories" .Params.Categories - "authors" .Params.Authors)}} + {{- $.Scratch.Add "algolia_index" (dict "objectID" .File.UniqueID + "date" .Date.UTC.Unix + "description" .Description + "dir" .File.Dir + "expirydate" .ExpiryDate.UTC.Unix + "fuzzywordcount" .FuzzyWordCount + "keywords" .Keywords + "kind" .Kind + "lang" .Lang + "lastmod" .Lastmod.UTC.Unix + "permalink" .Permalink + "publishdate" .PublishDate + "readingtime" .ReadingTime + "relpermalink" .RelPermalink + "summary" .Summary + "title" .Title + "type" .Type + "url" .RelPermalink + "weight" .Weight + "wordcount" .WordCount + "section" .Section + "tags" .Params.Tags + "authors" .Params.Authors)}} {{- end -}} {{- end -}} {{- end -}} -{{- $.Scratch.Get "index" | jsonify -}} \ No newline at end of file +{{- $.Scratch.Get "algolia_index" | jsonify -}} \ No newline at end of file diff --git a/layouts/_default/list.content.json b/layouts/_default/list.content.json index cce1d792273..190e523bfa8 100644 --- a/layouts/_default/list.content.json +++ b/layouts/_default/list.content.json @@ -4,30 +4,27 @@ {{- range .Site.AllPages -}} {{- if or (and (.IsDescendant $section) (and (not .Draft) (not .Params.private))) $section.IsHome -}} {{- if .File -}} - {{- $.Scratch.Add "index" (dict "objectID" .File.UniqueID + {{- $.Scratch.Add "index" (dict "objectID" .File.UniqueID "date" .Date.UTC.Unix "description" .Description "dir" .File.Dir "expirydate" .ExpiryDate.UTC.Unix - "fuzzywordcount" .FuzzyWordCount - "keywords" .Keywords + "fuzzywordcount" .FuzzyWordCount "kind" .Kind "lang" .Lang + "layout" .Layout "lastmod" .Lastmod.UTC.Unix "permalink" .Permalink "publishdate" .PublishDate "readingtime" .ReadingTime "relpermalink" .RelPermalink - "summary" .Summary + "section" .Section + "summary" .Summary "title" .Title "type" .Type "url" .RelPermalink "weight" .Weight - "wordcount" .WordCount - "section" .Section - "tags" .Params.Tags - "categories" .Params.Categories - "authors" .Params.Authors + "wordcount" .WordCount "track" .Params.track "project" .Params.project "topics" .Params.topics @@ -37,7 +34,6 @@ "when_day" .Params.when_day "when_time" .Params.when_time "hey_summit" .Params.hey_summit - "session_slack" .Params.session_slack "organizers" .Params.organizers "youtube_link" .Params.youtube_link "zoom_link" .Params.zoom_link