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:
authordigitalcraftsman <digitalcraftsman@protonmail.com>2016-06-14 19:53:33 +0300
committerdigitalcraftsman <digitalcraftsman@protonmail.com>2016-06-14 19:53:33 +0300
commiteda9d564550a4db678449b61b59728601befa9cb (patch)
treee1692aedf7d1692baedebcfb11aa9fcefa3963c8 /layouts
parent06542c91da5356bfad0529303984b691528c1642 (diff)
Fix access of non-existing category names
Caused template error in recent-article widget.
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/widgets/recent_articles.html2
1 files changed, 2 insertions, 0 deletions
diff --git a/layouts/partials/widgets/recent_articles.html b/layouts/partials/widgets/recent_articles.html
index 33a7c1d..fc5fec3 100644
--- a/layouts/partials/widgets/recent_articles.html
+++ b/layouts/partials/widgets/recent_articles.html
@@ -22,12 +22,14 @@
</div>
<div class="item-inner">
{{ if isset .Params "categories" }}
+ {{ if gt (len .Params.categories) 0 }}
<p class="item-category">
<a class="article-category-link" href="{{ $.Site.BaseURL }}categories/{{ index .Params.categories 0 | urlize | lower }}">
{{ index .Params.categories 0 }}
</a>
</p>
{{ end }}
+ {{ end }}
<p class="item-title"><a href="{{ .Permalink }}" class="title">{{ .Title }}</a></p>
<p class="item-date">
<time datetime="{{ .Date }}" itemprop="datePublished">{{ .Date.Format .Site.Params.date_format }}</time>