1
0
mirror of https://github.com/alrayyes/lastfm-hugo-demo-theme synced 2023-11-13 18:16:42 +00:00

Workaround for Hugo range bug

This commit is contained in:
Ryan Kes 2016-10-02 01:36:09 +02:00 committed by GitHub
parent 1355304e6d
commit 39a4713a7d

View File

@ -32,7 +32,7 @@
{{ range $dataJ.recenttracks.track }}
<a href="{{ .url }}" target="_new">
<div class="cover-card col-sm-4" style="background: url({{ range last 1 .image }}{{ if index . "#text" }}{{ index . "#text" }}{{ else }}http://img2-ak.lst.fm/i/u/300x300/c6f59c1e5e7240a4c0d427abd71f3dbb.png{{ end }}{{ end }}) no-repeat center top;background-size:cover;">
{{ range last 1 .image }}<div class="cover-card col-sm-4" style="background: url({{ if index . "#text" }}{{ index . "#text" }}{{ else }}http://img2-ak.lst.fm/i/u/300x300/c6f59c1e5e7240a4c0d427abd71f3dbb.png{{ end }}) no-repeat center top;background-size:cover;">{{ end }}
<p>
{{ printf "%s - %s" (index .artist "#text") .name }}<br>
-<br>