Commit f6a5185f authored by Laura Kalbag's avatar Laura Kalbag
Browse files

Remove empty tags and categories arrays to prevent empty template vars

(If tags: [] and categories: [] are empty, they will still show up on the page as "Categorised with:." Removing these arrays prevents that
parent 28a62dc0
{{- if (isset .Params "categories")}}
<p class='secondary categories'>{{ i18n "categorised" }}
{{- /* if the post has categories, range over those categories */}}
{{- range $index, $categories := .Params.categories -}}
{{- /* if there’s more than one tag, separate them with commas */}}
{{- if gt $index 0 }}, {{ end }}
<a href='{{ "categories/" | relURL }}{{ . | urlize }}'>{{ . }}</a>
{{- end }}.</p>
{{- if isset .Params "categories" }}
<p class='secondary categories'>{{ i18n "categorised" }}
{{- /* if the post has categories, range over those categories */}}
{{- range $index, $categories := .Params.categories -}}
{{- /* if there’s more than one tag, separate them with commas */}}
{{- if gt $index 0 }}, {{ end }}
<a href='{{ "categories/" | relURL }}{{ . | urlize }}'>{{ . }}</a>
{{- end }}.
</p>
{{- end }}
\ No newline at end of file
{{- if (isset .Params "tags")}}
<p class='secondary tags'>{{ i18n "tagged" }}
{{- /* if the post has tags, range over those tags */}}
{{- range $index, $tags := .Params.tags -}}
{{- /* if there’s more than one tag, separate them with commas */}}
{{- if gt $index 0 }}, {{ end }}
<a href='{{ "tags/" | relURL }}{{ . | urlize }}'>{{ . }}</a>
{{- end }}.</p>
{{- if isset .Params "tags" }}
<p class='secondary tags'>{{ i18n "tagged" }}
{{- /* if the post has tags, range over those tags */}}
{{- range $index, $tags := .Params.tags -}}
{{- /* if there’s more than one tag, separate them with commas */}}
{{- if gt $index 0 }}, {{ end }}
<a href='{{ "tags/" | relURL }}{{ . | urlize }}'>{{ . }}</a>
{{- end }}.
</p>
{{- end }}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment