Thanks for the steer. That’s handy.
And thanks @bep for updating the docs.
I’m trying to do something which I’ve seen raised on here several times but never quite seen achieved: allowing the user to select different versions of the same topic.
I’ve got a site like this:
+---Content\examples
\---my-first-topic
| _index.md
|
+---1.1
| index.md
|
+---1.2
| index.md
|
\---my-second-topic
| _index.md
|
+---1.1
| index.md
|
\---1.2
index.md
When I’m on a page, I’m trying to get an ?array of all the pages - both _index and regular - in the current section.
So if I’m at my-second-topic/_index.md
, I want:
my-second-topic/_index.md
my-second-topic/1.1/index.md
my-second-topic/1.2/index.md
I’ve tried {{ $pages := (where .Site.Pages "Section" .Section) }}
- that just gives me all the pages in /examples/
while {{ $pages := (where .Site.Pages "CurrentSection" .CurrentSection) }}
gives me nothing.
So I think I need to do some path manipulation. Something like "give me all pages which have the path of ( .CurrentSection with the end knocked off ) "