Music listing page

This commit is contained in:
David Eisinger
2025-02-16 02:26:24 -05:00
parent 43f54a4cd2
commit 42f4bc63ad
2 changed files with 9 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
# {{ .Title }}
{{ range where .Site.RegularPages "Params.exclude_music" "!=" true -}}
{{ range sort (.Resources.Match "*.mp3") "Title" "desc" -}}
=> {{ .RelPermalink }} {{ substr .Title 0 -4 }}
{{ end -}}
{{ end -}}

View File

@@ -11,7 +11,7 @@
{{ range findRE $audioRE $content -}} {{ range findRE $audioRE $content -}}
{{ $url := . | replaceRE $audioRE "$1" | replaceRE ` ` "%20" -}} {{ $url := . | replaceRE $audioRE "$1" | replaceRE ` ` "%20" -}}
{{ $title := . | replaceRE $audioRE "$2" -}} {{ $title := . | replaceRE $audioRE "$2" -}}
{{ $content = replace $content . (printf "=> %s %s" $url $title) -}} {{ $content = replace $content . (printf "=> %s %s" $url (substr $title 0 -4)) -}}
{{ end -}} {{ end -}}
{{ range findRE `{{<(dither|thumbnail) [^/]+/>}}` $content -}} {{ range findRE `{{<(dither|thumbnail) [^/]+/>}}` $content -}}
{{ $rendered := $page.RenderString . -}} {{ $rendered := $page.RenderString . -}}