Can we embed one (or more) post lists in a content page?

I’m probably going about this wrong, so I’ll try to express my desires before I get into my hacked together solution.

My goal

For my company’s website, we have several categories of iterative content, like “Case studies” and “Advisors”. These categories are organized in a tree already.

I’d like to create *.md pages that allow the non-technical content creators to customize the header and some content at the top of the page, and below that, I’d like to add a series of sections, each of which lists one of the child directories’ posts.

An example output might look like:

<head>
    <title>About us</title>
</head>
<body>
    <!-- Marketing content generated from /content/about/index.md -->
    <h1>About us</h1>
    <!-- Leadership team list generated automatically from /content/about/leaders/* -->
    <section>
        <h2>Leadership team</h2>
        <ul>
            <li>
                <!-- Content from /content/about/leaders/first_last.md* -->
            </li>
        </ul>
    </section>
    <!-- Foo list generated automatically from /content/about/foo/* -->
    <section>
        <h2>Foo</h2>
        <ul>
            <li>
                <!-- Content from /content/about/foo/bar.md* -->
            </li>
        </ul>
    </section>
</body>

How I’m doing it now

I’m creating custom layouts for each of quasi-list-based index pages , and the layouts use partials that render every page that matches a custom .Params.type. So my /content/about/index.md page is heavily customized in a /layouts/about.html file.

I feel like there should be a better way to do at least one of the following:

  • Use a shortcode that can access the .Site.Pages object, so my content creators could write something like {{< list 'leader' >}} in a content page anywhere on the side to get a list of all content with .Params.type = ‘leader’
  • Use a custom layout, but iterate through that page’s “children” instead of filtering all pages by type.
  • Use a list.html page template, without sacrificing the ability to have easily customized markdown content for the content creator.

Are these approaches feasible with the existing tech, and I’m just missing some core concepts in the documentation? Ideally, I’d like to be able to do more than one of these, so that the home page of the site could cherry-pick some content lists via a shortcode, but several sections would have automatic grouped lists of their children directories. That way the content creators could freely add subsections, without sacrificing the ability to fine-tune the home page.