Hi, I've made several directories, 3 of them being French-speaking, one
of them being English-speaking.
I'd like to index all my French-speaking posts into a single,
chronological (reverse-order) index.
So far my config is the following:
{{ with .site.Root.GetPage (coquelicots/, nocturnes/, lilas/) }}
{{ range .Pages }}
=> {{ .URL }} {{ .Title }}
{{ end }}
{{ end }}
I'm not sure I'm getting how to use several arguments right (by following
https://pkg.go.dev/text/template). Thank you in advance for reading this,
and for any help.
On Thu Dec 8, 2022 at 4:37 AM EST, Océane Raquin wrote:
> Hi, I've made several directories, 3 of them being French-speaking, one
> of them being English-speaking.
>
> I'd like to index all my French-speaking posts into a single,
> chronological (reverse-order) index.
>
> So far my config is the following:
>
> {{ with .site.Root.GetPage (coquelicots/, nocturnes/, lilas/) }}
> {{ range .Pages }}
> => {{ .URL }} {{ .Title }}
> {{ end }}
> {{ end }}
>
> I'm not sure I'm getting how to use several arguments right (by following
> https://pkg.go.dev/text/template). Thank you in advance for reading this,
> and for any help.
The GetPage function currently only takes one argument. So you'll need
to duplicate the template (or use a partial template) for each
directory:
{{ with .site.Root.GetPage "directory1" }}
{{ partial "pages.gmi" . }}
{{ end}}
{{ with .site.Root.GetPage "directory2" }}
{{ partial "pages.gmi" . }}
{{ end}}
{{/* ... */}}
There aren't any functions which can merge groups of pages into a single
list. I might accept a patch to add one, though. You might also consider
putting all your posts in a single directory and using permalinks to
place them in different directories in the output directory. That would
work better with the current design.