add title filter to dirs and include underscores for documents layout

This commit is contained in:
Jakub 2024-03-03 00:37:26 -05:00
parent 293ced3505
commit 55122f137d

View File

@ -12,11 +12,11 @@
{{- range $files -}}
<li>
{{- if .IsDir -}}
{{ title .Name }}
{{ title (replaceRE `[_-]` " " (path.BaseName .Name)) }}
{{- template "listDir" (dict "dir" (printf "%s/%s" $dir .Name)) -}}
{{- else -}}
{{- with resources.Get (printf "%s/%s" $dir .Name) -}}
<a href="{{ .RelPermalink }}">{{ title (replace (path.BaseName .Name) "-" " ") }}</a>
<a href="{{ .RelPermalink }}">{{ title (replaceRE `[_-]` " " (path.BaseName .Name)) }}</a>
{{- end -}}
{{- end -}}
</li>