2018-08-17 23:03:39 +01:00
|
|
|
{{ define "main" }}
|
|
|
|
<div id="main">
|
|
|
|
<div class="container">
|
|
|
|
{{ partial "content.html" . }}
|
|
|
|
|
|
|
|
{{ $user := default .Site.Data.social.accounts.spotify.username .Params.user }}
|
|
|
|
|
|
|
|
{{ $playlist := getJSON "https://spotify-public-proxy.herokuapp.com/v1/users/" $user "/playlists/" .Params.playlist }}
|
|
|
|
|
|
|
|
<div class="playlist">
|
|
|
|
<h3>
|
|
|
|
<i class="fab fa-spotify"></i>
|
|
|
|
<a href="{{ $playlist.external_urls.spotify }}">
|
|
|
|
{{ $playlist.name }}
|
|
|
|
</a>
|
|
|
|
</h3>
|
|
|
|
|
2019-03-16 16:02:38 +00:00
|
|
|
<table class="table table-hover table-striped table-dark">
|
2018-08-17 23:03:39 +01:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2018-12-01 21:44:23 +00:00
|
|
|
<th scope="row"></th>
|
2018-08-17 23:03:39 +01:00
|
|
|
<th scope="row"></th>
|
|
|
|
<th scope="row">Track</th>
|
|
|
|
<th scope="row">Artist</th>
|
|
|
|
<th scope="row">Album</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{ range sort $playlist.tracks.items "track.name" }}
|
|
|
|
{{ with .track }}
|
2018-12-01 21:44:23 +00:00
|
|
|
{{ $spotify_url := .external_urls.spotify }}
|
2018-08-17 23:03:39 +01:00
|
|
|
<tr>
|
2018-12-01 21:44:23 +00:00
|
|
|
{{ with index .album.images 0 }}
|
|
|
|
<td>
|
|
|
|
<a href="{{ $spotify_url }}"><div class="image" data-image="{{ .url }}"></div></a>
|
|
|
|
</td>
|
2018-08-17 23:03:39 +01:00
|
|
|
{{ end }}
|
2018-12-01 21:44:23 +00:00
|
|
|
<td class="text-center">
|
|
|
|
{{ if .preview_url }}
|
|
|
|
<a href="{{ .preview_url }}"><i class="fas fa-play"></i></a>
|
|
|
|
{{ end }}
|
|
|
|
</td>
|
|
|
|
<td><a href="{{ $spotify_url }}">{{ .name }}</a></td>
|
2018-08-17 23:03:39 +01:00
|
|
|
<td>
|
|
|
|
{{ range $i, $e := .artists }}{{ if $i }}, {{ end }}{{ .name }}{{ end }}
|
|
|
|
</td>
|
|
|
|
<td>{{ .album.name }}</td>
|
|
|
|
</tr>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-08-17 23:19:40 +01:00
|
|
|
{{ partial "share.html" . }}
|
2020-07-24 22:44:08 +01:00
|
|
|
{{ partial "related-content.html" . }}
|
2018-08-17 23:03:39 +01:00
|
|
|
</div>
|
|
|
|
{{ end }}
|