I already read the docs for this and I have no clue. I tried everything I came with.
I have this in my config.yaml
:
taxonomies:
tag: "tags"
category: "categories"
series: "series"
I use series
to group posts in a serie (obviously) and I want to add to the end of that posts a list with a list of the serie’s posts (using the Params.series
value from actual article, series: ["Mi Raspberry Pi"]
, for example). For that, I created a partial layout, serie.html
:
{{ with .Params.series }}<div class="serie">
<hr />
<ul>
{{ range NeedHereToCicleBetweenPostsInTheSameSerie }}
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
</div>{{ end }}
And I’m calling to that partial in _default/single.html
(for now):
{{ partial "head.html" . }}
<body class="index">
<!-- header -->
{{ partial "header.html" . }}
<div class="container">
{{ if .Params.toc }}{{ .TableOfContents }}{{ end }}
<article class="content">
<h1 class="posttitle">{{ .Title }}</h1>
<!-- content -->
{{ .Content }}
{{ partial "serie.html" . }}
</article>
</div>
<!-- footer -->
{{ partial "footer.html" . }}
</body>
</html>
And I’m going crazy, because it doesn’t populate the list, whatever I do. I can get the Params.series
value (that is a list) and also their first value, but nothing more. I don’t plan to use more than one series in an article, but I declared it like a list because I saw it expecified that way in docs. I also tried with a plain string, with same (no) results.
I guess the key is in
{{ range NeedHereToCicleBetweenPostsInTheSameSerie }}
in the partial serie.html
. I re-did this with SO MANY variations, all looking pretty logical to me, without exit. So I’m really confused now and can’t say what this should to be >_<.
Using where
function to filter site pages with series taxonomy term especified in Params.series
(previously saved in a variable), and many others variations. I don’t know what to do any more.
All of my articles are, for now, in section post
, where I have a folder for every year, with the .md
inside.
Any help? Suggestions? Thanks for your time.
I’m still using the stable version of Hugo ( v0.13).