diff options
author | digitalcraftsman <digitalcraftsman@users.noreply.github.com> | 2016-01-03 23:43:45 +0300 |
---|---|---|
committer | digitalcraftsman <digitalcraftsman@users.noreply.github.com> | 2016-01-03 23:43:45 +0300 |
commit | fd0cc33c43dc5344d0bd77872cb16dc27b460072 (patch) | |
tree | c595e0b23923c64c7725fc1a08de4183909253dd | |
parent | 246085abbaeb329e4c688de5e72b671ac16465da (diff) |
Fix reflection error in templates
-rw-r--r-- | layouts/partials/profile.html | 6 | ||||
-rw-r--r-- | layouts/partials/widgets/categories.html | 2 | ||||
-rw-r--r-- | layouts/partials/widgets/recent_articles.html | 2 | ||||
-rw-r--r-- | layouts/partials/widgets/tag_cloud.html | 2 | ||||
-rw-r--r-- | layouts/partials/widgets/tags.html | 2 |
5 files changed, 12 insertions, 2 deletions
diff --git a/layouts/partials/profile.html b/layouts/partials/profile.html index 4559120..5a077c5 100644 --- a/layouts/partials/profile.html +++ b/layouts/partials/profile.html @@ -17,7 +17,11 @@ <span>{{with .Site.Data.l10n.profile.posts}}{{.}}{{end}}</span> </div> <div class="article-info-block"> - {{ len .Site.Taxonomies.tags }} + {{ if isset .Site.Taxonomies "tags" }} + {{ len .Site.Taxonomies.tags }} + {{ else }} + 0 + {{ end }} <span> {{with .Site.Data.l10n.profile.tags}}{{.}}{{end}} </span> diff --git a/layouts/partials/widgets/categories.html b/layouts/partials/widgets/categories.html index 99947b3..566a2ae 100644 --- a/layouts/partials/widgets/categories.html +++ b/layouts/partials/widgets/categories.html @@ -1,4 +1,5 @@ {{ if .Site.Params.widgets.categories }} +{{ if isset .Site.Taxonomies "categories" }} {{ if not (eq (len .Site.Taxonomies.categories) 0) }} <div class="widget-wrap"> <h3 class="widget-title">{{with .Site.Data.l10n.widgets.categories.title}}{{.}}{{end}}</h3> @@ -17,3 +18,4 @@ </div> {{ end }} {{ end }} +{{ end }}
\ No newline at end of file diff --git a/layouts/partials/widgets/recent_articles.html b/layouts/partials/widgets/recent_articles.html index 4b4c97d..ab2e01d 100644 --- a/layouts/partials/widgets/recent_articles.html +++ b/layouts/partials/widgets/recent_articles.html @@ -17,7 +17,7 @@ </a> </div> <div class="item-inner"> - {{ if ge (len .Params.categories ) 1 }} + {{ if isset .Params "categories" }} <p class="item-category"> <a class="article-category-link" href="{{ $.Site.BaseURL }}categories/{{ index .Params.categories 0 | urlize | lower }}"> {{ index .Params.categories 0 }} diff --git a/layouts/partials/widgets/tag_cloud.html b/layouts/partials/widgets/tag_cloud.html index da139f0..5bfd5da 100644 --- a/layouts/partials/widgets/tag_cloud.html +++ b/layouts/partials/widgets/tag_cloud.html @@ -1,4 +1,5 @@ {{ if .Site.Params.widgets.tag_cloud }} +{{ if isset .Site.Taxonomies "tags" }} {{ if not (eq (len .Site.Taxonomies.tags) 0) }} <div class="widget-wrap"> <h3 class="widget-title"> @@ -12,3 +13,4 @@ </div> {{ end }} {{ end }} +{{ end }}
\ No newline at end of file diff --git a/layouts/partials/widgets/tags.html b/layouts/partials/widgets/tags.html index 4d485cb..cf97e36 100644 --- a/layouts/partials/widgets/tags.html +++ b/layouts/partials/widgets/tags.html @@ -1,4 +1,5 @@ {{ if .Site.Params.widgets.tags }} +{{ if isset .Site.Taxonomies "tags" }} {{ if not (eq (len .Site.Taxonomies.tags) 0) }} <div class="widget-wrap"> <h3 class="widget-title"> @@ -19,3 +20,4 @@ </div> {{ end }} {{ end }} +{{ end }}
\ No newline at end of file |