mirror of
https://github.com/by-jp/www.byjp.me.git
synced 2025-08-08 17:15:56 +01:00
15 lines
589 B
INI
15 lines
589 B
INI
{{ $out := "" }}
|
|
{{ if hasPrefix . "https://open.spotify.com/track/" }}
|
|
{{ $out = (printf "https://song.link/s/%s" (substr . 31)) }}
|
|
{{ else if hasPrefix . "https://open.spotify.com/album/" }}
|
|
{{ $out = (printf "https://song.link/s/%s" (substr . 31)) }}
|
|
{{ else if hasPrefix . "https://open.spotify.com/" }}
|
|
{{/* Spotify artists, users & playlists *must* go to spotify */}}
|
|
{{ $out = . }}
|
|
{{else if hasPrefix . "soundcloud:/tracks/"}}
|
|
{{ $out = (printf "https://song.link/sc/%s" (substr . 19)) }}
|
|
{{ else }}
|
|
{{ errorf "Unknown music link: %s" . }}
|
|
{{ end }}
|
|
|
|
{{ return $out }}
|