Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/toryanderson/hugo-icarus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKanishk Kunal <kanishk.kunal@hotmail.com>2015-11-30 11:43:01 +0300
committerKanishk Kunal <kanishk.kunal@hotmail.com>2015-11-30 11:43:01 +0300
commit3c78e0709176b9c63840e65bfed47cf50f321974 (patch)
tree445c14c06c57111cb6da35ba117fd4d42ac32a6b /layouts
parent8236d9e2fbeda90ba28efecc9d3b60d96f4e16b9 (diff)
Setting default thumbnail when no banner image is present for recent articles.
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/widgets/recent_articles.html8
1 files changed, 5 insertions, 3 deletions
diff --git a/layouts/partials/widgets/recent_articles.html b/layouts/partials/widgets/recent_articles.html
index 031d295..8ce6833 100644
--- a/layouts/partials/widgets/recent_articles.html
+++ b/layouts/partials/widgets/recent_articles.html
@@ -7,13 +7,15 @@
<ul id="recent-post">
{{ range first 5 (where .Site.Pages "Type" "post") }}
<li>
- {{ with .Params.banner }}
<div class="item-thumbnail">
<a href="{{ $.Permalink }}" class="thumbnail">
- <span style="background-image:url({{ $.Site.BaseURL }}{{ . }})" alt="{{ $.Title }}" class="thumbnail-image"></span>
+ {{ if isset .Params "banner" }}
+ <span style="background-image:url({{ $.Site.BaseURL }}{{ .Params.banner }})" alt="{{ $.Title }}" class="thumbnail-image"></span>
+ {{else}}
+ <span style="background-image:url({{ .Site.BaseURL }}css/images/thumb-default-small.png)" alt="{{ $.Title }}" class="thumbnail-image"></span>
+ {{ end }}
</a>
</div>
- {{ end }}
<div class="item-inner">
{{ if ge (len .Params.categories ) 1 }}
<p class="item-category">