From d4c49877212e954eb15f067e38bcc1d2d8ccc91b Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 15 Oct 2017 15:25:54 +0100 Subject: [PATCH] Add spotify playlist shortcode --- layouts/shortcodes/spotify.html | 41 +++++++++++++++++++++++++++++++++ static/src/scss/style.scss | 4 ++++ 2 files changed, 45 insertions(+) create mode 100644 layouts/shortcodes/spotify.html diff --git a/layouts/shortcodes/spotify.html b/layouts/shortcodes/spotify.html new file mode 100644 index 0000000..7a634da --- /dev/null +++ b/layouts/shortcodes/spotify.html @@ -0,0 +1,41 @@ +{{ $ident := .Get 0 }} + +{{ $playlist := getJSON "http://spotify-public-proxy.theorangeone.net/playlist/" $ident }} + +
+ +

+ {{ $playlist.name }} +

+
+ + + + + + + + + + + + {{ range sort $playlist.tracks "name" }} + + + + + + + {{ end }} + + +
TrackArtistAlbum
+ + + + {{ .name }} + {{ range $i, $e := .artists }}{{ if $i }}, {{ end }}{{ .name }}{{ end }} + {{ .album.name }}
+ View playlist on Spotify +
+
diff --git a/static/src/scss/style.scss b/static/src/scss/style.scss index 1625ef2..731306e 100644 --- a/static/src/scss/style.scss +++ b/static/src/scss/style.scss @@ -188,3 +188,7 @@ nav { text-align: center; } } + +table td { + vertical-align: middle; +}