davideisinger.com

My personal website
Log | Files | Refs | README

commit 42f4bc63adce93ab91350d5553c89090afbf0fb5
parent 43f54a4cd22fdb0b370b1648736267618db83d54
Author: David Eisinger <[email protected]>
Date:   Sun, 16 Feb 2025 02:26:24 -0500

Music listing page

Diffstat:
Athemes/v2/layouts/music/list.gmi | 8++++++++
Mthemes/v2/layouts/partials/gemtext.gmi | 2+-
2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/themes/v2/layouts/music/list.gmi b/themes/v2/layouts/music/list.gmi @@ -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 -}} + diff --git a/themes/v2/layouts/partials/gemtext.gmi b/themes/v2/layouts/partials/gemtext.gmi @@ -11,7 +11,7 @@ {{ range findRE $audioRE $content -}} {{ $url := . | replaceRE $audioRE "$1" | replaceRE ` ` "%20" -}} {{ $title := . | replaceRE $audioRE "$2" -}} -{{ $content = replace $content . (printf "=> %s %s" $url $title) -}} +{{ $content = replace $content . (printf "=> %s %s" $url (substr $title 0 -4)) -}} {{ end -}} {{ range findRE `{{<(dither|thumbnail) [^/]+/>}}` $content -}} {{ $rendered := $page.RenderString . -}}