diff options
Diffstat (limited to 'templates/index.tmpl')
| -rw-r--r-- | templates/index.tmpl | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/templates/index.tmpl b/templates/index.tmpl index 2451c6b..1ab1726 100644 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -1,21 +1,26 @@ {{template "header" . }} <h2>Recent Listens</h2> <ul class="scrobbles"> + {{if .NowPlaying}} {{template "song" .NowPlaying}} {{end}} {{- range .Scrobbles}} + {{template "song" .}} +{{- end}} +</ul> +{{template "footer" }} + +{{define "song"}} <li> - <img src="{{or .Image "https://lastfm-img2.akamaized.net/i/u/64s/4128a6eb29f94943c9d206c08e625904.png"}}"/> + <img class="cover" src="{{or .Image "https://lastfm-img2.akamaized.net/i/u/64s/4128a6eb29f94943c9d206c08e625904.png"}}"/> <div> {{.Artist}} — {{.TrackName}}<br/> <span class="album">in {{.Album}}</span> </div> <div class="like"> - <span class="album">{{ago .Time}}</span><br/> + <span class="time">{{.Time | ago}}</span><br/> <span class="swap"> <i class="material-icons one">favorite_border</i> <i class="material-icons two">favorite</i> </span> </div> </li> -{{- end}} -</ul> -{{template "footer" }} +{{end}} |
