www.byjp.me/layouts/shortcodes/spotify.html
JP Hastings-Spital 45b7c16257
Some checks failed
/ build (push) Has been cancelled
fix: Finally fix Songwhip links
2025-07-26 14:59:29 +01:00

10 lines
752 B
HTML

{{- $displayArtist := (.Get "composer") | default (.Get "artist") -}}
{{- $displayTitle := (.Get "title") | default (.Get "album") -}}
{{- $url := partial "songlink.url" (printf "https://open.spotify.com%s" (.Get "path")) -}}
<figure class="embed audio spotify">
<iframe src="https://open.spotify.com/embed{{ .Get "path" }}" height="80" frameBorder="0" allowfullscreen="" allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture" loading="lazy"></iframe>
<figcaption>
🎶 {{ $displayArtist }}{{ with $displayTitle }}{{ if $displayArtist }}: {{ end }}<em>{{ . }}</em>{{ end }}<br/>
{{ with $url }}<a href="{{ . }}" target="_blank" style="font-style:italic;">Listen elsewhere</a>{{ end }}
</figcaption>
</figure>