How to list /content/section/subsection1, subsection2, etc

Hello. On my site, you see towards the bottom, “Find The Others” section which comes from /content/community.

It lists all the pages as in I am doing

{{ range first 15 (where .Site.Pages "Type" "community") | shuffle}}
{{ range first 15 (where .Site.RegularPages "Section" "community") | shuffle}}

And I’ve tried many other variations of this as well, but I can’t get it to list only the countries underneath.

In the section I have


Etc. So I’ve got the directory structure correct, which shows up fine when you go to the individual sections. However, in the main page, the renders pages, instead of the countries only.

I would like to list only the countries and no other pages in I can’t seem to figure out this thing.

Say for example you go to you see only the countries listed here.

I want the same exact thing on but I can only ever get ALL the pages in Communities.

I’m not sure how to grab a list of these subsections only. If you look in the repository, every country has it’s own file.

Here is the link to the repository:

After many hours of searching the forums, I found this: Listing nested directories

Then I did what @budparr suggested:

{{ $sections := (.Site.GetPage "section" "community").Sections }}

{{ range first 15 $sections | shuffle}}

And that shows the countries only now. I never heard of the .GetPage function. I do not see this mentioned on unless I missed something.

What does this function really do? .GetPage from section called community and then get .Sections from that? I didn’t even know you could do that. Cool.

I found the function here instead. I didn’t realize one could call functions on .Site.