Only show image if exists

This commit is contained in:
Las Zenow 2012-08-15 17:12:40 +02:00
parent 7d5ca83a36
commit 2e19245f39
3 changed files with 5 additions and 3 deletions

View file

@ -11,7 +11,8 @@
<ul>
{{with .Books}}
{{range .}}
<li><a href="/book/{{.Title}}"><img src="{{.CoverSmall}}" alt="{{.Title}}" /><strong>{{.Title}}</strong></a> - {{range .Author}}{{.}}, {{end}}</li>
<li><a href="/book/{{.Title}}">{{if .CoverSmall}}<img src="{{.CoverSmall}}" alt="{{.Title}}" />{{end}}
<strong>{{.Title}}</strong></a> - {{range .Author}}{{.}}, {{end}}</li>
{{end}}
{{end}}
</ul>