www.byjp.me/layouts/shortcodes/spotify.gmi
JP Hastings-Spital 732f936053 First Gemini Compatibility
This seems to mostly work! It's configured to work with Agate, and I haven't figured out the deploy mechanism yet — but it's a start!
2024-04-29 15:27:50 +01:00

8 lines
456 B
Text

{{- $displayArtist := (.Get "composer") | default (.Get "artist") -}}
{{- $displayTitle := (.Get "title") | default (.Get "album") -}}
{{- $songwhip := .Get "url" -}}
{{- if $displayArtist -}}
{{- $songwhip = printf "https://songwhip.com/%s/%s" (partial "kebab.txt" (.Get "artist")) (partial "kebab.txt" $displayTitle) }}
{{- end -}}
=> {{ $songwhip }} 🎵 {{ $displayArtist }}{{ with $displayTitle }}{{ if $displayArtist }}: {{ end }}{{ . }}{{ end }}