fix search results to use filenames if no title

This commit is contained in:
a 2022-11-26 10:33:17 -06:00
parent 3648d10eb9
commit f0b5061491

View file

@ -1,7 +1,7 @@
{{- $.Scratch.Add "pagesIndex" slice -}}
{{- range $index, $page := .Site.RegularPages -}}
{{- if gt (len $page.Content) 0 -}}
{{- $pageData := (dict "title" $page.Title "href" $page.Permalink "content" $page.Plain) -}}
{{- $pageData := (dict "title" (or $page.Title $page.File.LogicalName) "href" $page.Permalink "content" $page.Plain) -}}
{{- $.Scratch.Add "pagesIndex" $pageData -}}
{{- end -}}
{{- end -}}