Hello,
I am trying to get nested sections to work, but I only get the first level is sections when I use :
{{ range .Pages }}
I only get the first level of sections.
This is my folders:
- content
|
-formations
course1.md
cours2.md
|
-parcours1
|
- _index.md
- parcours1.md
In `themes/mytheme/layours/formations/list.html I have
{{ range .Pages }}
<div class="m-b-3">
<h1>{{ .Title }}</h1>
<a href="{{ .Permalink }}">{{ .Permalink }}</a>
</div>
{{ end }}
I am only getting cours1 and cours2 listed
bep
2
It is a tree, you only go down 1 level.
Look at this example:
Okay I see you do :
{{ range .Sections}}
{{ end }}
Is that new ? When I range section, I get my parcours1 with the correct link
Also, why did you use .Reverse?
Thanks for the quick reply!
bep
4
The example site should explain it; if not you would have to wait for us to improve on the documentation.
Crap okay thanks for your help, I appreciate it very much
@bep I got it to work, thank you.
I was wondering if it’s possible to do something like this :
http://localhost:1313/formations/
list of formations
http://localhost:1313/formations/buildmaster/
list of buildmaster
http://localhost:1313/formations/buildmaster/jenkins/
single page with a link towards http://localhost:1313/formations/buildmaster/jenkins/thecourse.md
The problem I am having is that in the jenkins folder I have an _index.md but it’s treating it like a list.
Also I noticed in your exemple you have empty <ul>
Can you do if subsection?