diff options
author | digitalcraftsman <digitalcraftsman@protonmail.com> | 2016-06-14 19:53:33 +0300 |
---|---|---|
committer | digitalcraftsman <digitalcraftsman@protonmail.com> | 2016-06-14 19:53:33 +0300 |
commit | eda9d564550a4db678449b61b59728601befa9cb (patch) | |
tree | e1692aedf7d1692baedebcfb11aa9fcefa3963c8 /layouts | |
parent | 06542c91da5356bfad0529303984b691528c1642 (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.html | 2 |
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> |