Skip to content

Commit

Permalink
MAke file_stat for local podcast files work if in subdir.
Browse files Browse the repository at this point in the history
  • Loading branch information
frjo committed Aug 28, 2023
1 parent cfdcf5c commit d0d2798
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion layouts/podcast/rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
{{ end -}}
<description>{{ .Content | html }}</description>
{{ if site.Params.Podcast.local | default true -}}
{{ with .Params.podcast.mp3 }}{{ $file_stat := os.Stat (path.Join "/static" (. | relURL)) }}<enclosure url="{{ if site.Params.Podcast.cdn }}{{ path.Join site.Params.Podcast.cdn (. | relURL) }}{{ else }}{{ . | absURL }}{{ end }}" length="{{ $file_stat.Size }}" type="audio/mpeg" />{{ end }}
{{ with .Params.podcast.mp3 }}{{ $file_stat := os.Stat (path.Join "/static" .) }}<enclosure url="{{ if site.Params.Podcast.cdn }}{{ path.Join site.Params.Podcast.cdn (. | relURL) }}{{ else }}{{ . | absURL }}{{ end }}" length="{{ $file_stat.Size }}" type="audio/mpeg" />{{ end }}
{{ else -}}
{{ with .Params.podcast.mp3 }}<enclosure url="{{ if site.Params.Podcast.cdn }}{{ add site.Params.Podcast.cdn (. | relURL) }}{{ else }}{{ . | absURL }}{{ end }}" type="audio/mpeg" />{{ end }}
{{ end -}}
Expand Down

0 comments on commit d0d2798

Please sign in to comment.