I tried other way.
I set categories name to .Site.Params.
[params]
categories = ["golang", "html"]
I try iterate it’s list and I get post with a specific categories by where method.
So I write this code, but it don’t work because this error message.
<div id="params">
{{ $site := . }}
{{ range .Site.Params.categories }}
<div class="category_name">{{ . }}</div>
<ul class="posts">
{{ range where $site.Data.Pages .Params.tags "in" "golang" }}
<li>{{ .Title }}</li>
{{ end }}
</ul>
{{ end }}
</div>
ERROR: 2015/03/02 Error while rendering homepage: template: theme/index.html:28:
59: executing "theme/index.html" at <.Params.tags>: can't evaluate field Params
in type interface {}
But this code work well and no post displayed
<div id="params">
{{ range where .Data.Pages .Params.tags "in" "golang" }}
<div>where tags {{ .Title }} {{ .Params.tags }} </div>
{{ end }}
</div>
I think $site.Data.Pages in upper case is equal to .Data.Pages in lowre case.
But it isn’t same result, and lower case doesn’t work.
It’s double Dutch to me.