List all pages under a sub-section folder

My site has the following structure,

--  content /
     -- cn /
         -- post /
         -- teach /
     -- en /
         -- post /
         -- read /

And I want to list all the posts in the folder “content/cn/post” but not the posts in the folder “content/cn/teach”.
But the rendered list contained all the posts both in “content/cn/post” and in “content/cn/teach”.
What should I do to fulfill my aims?
The following is the source code of my site: https://github.com/rbind/likan
Thanks.

Wait for the next release. See this https://discuss.gohugo.io/t/feedback-wanted-nested-sections-content-structure/6692/23

You can try to generate a layout in layouts/cn/post/list.html and/or layouts/cn/post/single.html. You can even give it a custom name and reference it through the post’s Front Matter. Here’s Hugo’s Lookup Order: Lookup Order.

Thanks. And it seems that Leo’s methods don’t work. I finally came out a tricky way to have this down.
I added a where function to filter the pages listed:
{{ range where .Pages "File.Dir" "in" "/cn/post/" }}
Really hope the next release will make this easier.

Thanks.

4 Likes