hacker.tours-website/themes/zen/layouts/partials/podcast.html
2024-06-13 22:14:05 +02:00

12 lines
751 B
HTML

{{ $src := (.Params.podcast.mp3 | absURL) -}}
{{ if site.Params.Podcast.cdn -}}
{{ $src = add site.Params.Podcast.cdn (.Params.podcast.mp3 | relURL) -}}
{{ end -}}
<figure class="podcast">
<audio controls preload="{{ site.Params.Podcast.preload | default "metadata" }}"><source src="{{ $src }}" type="audio/mpeg"></audio>
<figcaption><a href="{{ $src }}">{{ .Title }}</a></figcaption>
</figure>
{{ with .Params.podcast.image }}
{{ $resource := resources.Get .src }}{{ $size := "250x" }}{{ with .width }}{{ $size = (add (string .) "x") }}{{ end }}{{ $image := $resource.Resize $size -}}
<figure class="image {{ .class | default "right" }}"><img src="{{ $image.RelPermalink }}" width="{{ .width | default "250" }}" alt="{{ .alt }}"></figure>
{{ end -}}