generate correct audio title

This commit is contained in:
Stefan Majewsky 2022-04-23 20:32:53 +02:00
parent e3953dbc75
commit a1c1a08ff7
2 changed files with 5 additions and 1 deletions

View File

@ -35,6 +35,10 @@ var funcs = map[string]interface{}{
return time.Now().Local().Format("2006-01-02T15:04:05")
},
"monthname": func(month int) string {
return monthWords[month]
},
"filesize": func(file string) (int64, error) {
fi, err := os.Stat(file)
if err != nil {

View File

@ -10,7 +10,7 @@
<resource size="{{ filesize (onlymp3 .AudioFileNames) }}"
type="{{ mimetype (onlymp3 .AudioFileNames) }}"
url="https://ftp.c3d2.de/pentaradio/{{ onlymp3 .AudioFileNames }}"
title="pentaradio24 vom 22. März 2022">
title="pentaradio24 vom {{ .Day }}. {{ monthname .Month }} {{ .Year }}">
{{- range (exceptmp3 .AudioFileNames) }}
<alternative size="{{ filesize . }}" type="{{ mimetype . }}" url="https://ftp.c3d2.de/pentaradio/{{ . }}"/>
{{- end }}