Hello. I need help. I have 10 articles in the Section with content and 20 articles with custom param ‘go’. I want to publish articles with content only.
My code is
{{ range $index, .Paginator.Pages }}{{ .Render "blog_section.li" }}{{ end }}{{ range where (where .Site.RegularPages "Section" "blog") ".Params.go" "!=" "" }}{{ end }}
Look. I added new variable - ‘redirect’.
Now I have two types of articles:
+++
layout = “blog_single_tpl”
title = “7 Useful Options for Content Protection”
date = “2017-10-18T00:00:00+03:00”
redirect = 0
+++
+++
layout = “301”
title = “10% Discount on CDN from G-Core Labs”
go = “/news/10-discount-on-cdn-for-new-customers/”
redirect = 1
+++
The code is
<ul class="list_grid">
{{ range $index, .Paginator.Pages }}q{{ end }}{{ range where ( where .Pages "Section" "blog") "Params.redirect" 0 }}{{ end }}
</ul>
{{ partial "pagination" . }}