Browse Source

generate correct audio title

main
Stefan Majewsky 4 months ago
parent
commit
a1c1a08ff7
  1. 4
      generate.go
  2. 2
      news.xml.gotpl

4
generate.go

@ -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 {

2
news.xml.gotpl

@ -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 }}

Loading…
Cancel
Save