Theme: How to get the list of sub-section in single.html

Updated: As I am not able to delete this post, I am updating it here.I think I managed to get what I want to achieve now. I will share it for feedback after I’ve done a few tests.

Thanks all!


Let’s say I am following this page to create a few nested section.


└── content
├── post
| ├── // <-
| ├── happy
| | └── // <-
| | └── // <-

When I access, I like to display the sub-sections which are under “happy”.

How do I get the list of sub-section from single.html?

I tried with this code below but I got the build error “ERROR: 2015/11/16 Error while rendering page post\happy\post\happy\ reflect: call of reflect.Value.Type on zero Value


<h1>{{ .Title }}</h1>
	{{ .Content }}
{{ range  where .Data.Pages "Section" "happy" }}
	  <a href="{{ .Permalink }}">
		{{ .Title }}
 {{ .Content }}
{{ end }}`

Is there any way to iterate the sub-sections from single.html under post?