Jake Howard
7dd9793f03
Couldn't get it showing pages in the past, because Hugos docs on what the default are appear to be incorrect
58 lines
1.8 KiB
HTML
58 lines
1.8 KiB
HTML
{{ 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>
|
|
|
|
<table class="table table-hover table-striped table-dark">
|
|
<thead>
|
|
<tr>
|
|
<th scope="row"></th>
|
|
<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 }}
|
|
{{ $spotify_url := .external_urls.spotify }}
|
|
<tr>
|
|
{{ with index .album.images 0 }}
|
|
<td>
|
|
<a href="{{ $spotify_url }}"><div class="image" data-image="{{ .url }}"></div></a>
|
|
</td>
|
|
{{ end }}
|
|
<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>
|
|
<td>
|
|
{{ range $i, $e := .artists }}{{ if $i }}, {{ end }}{{ .name }}{{ end }}
|
|
</td>
|
|
<td>{{ .album.name }}</td>
|
|
</tr>
|
|
{{ end }}
|
|
{{ end }}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{{ partial "share.html" . }}
|
|
{{ partial "related-content.html" . }}
|
|
</div>
|
|
{{ end }}
|