hi,
i am filtering my posts by some tag and putting it in a variable. now what is the correct way to render something only if that variable is not empty.
here is my code.
Thanks.
{{ $truncate := default true .Site.Params.truncate }}
{{ $postlist := .Site.Taxonomies.tags.ssc_jobs}}
{{if (eq $postlist "") }}
{{.Render "nothing"}}
{{else}}
{{range first 10 $postlist}}
{{ if $truncate }}
{{ .Render "summary" }}
{{ else }}
{{ .Render "content" }}
{{ end }}
{{ end }}
{{end}}
and here is output