Get pages from multiple sections in one list

I have a folder in “content” called “projects” which has sub folders and also sub-sub folders. I’m trying to get the latest 12 pages content of all the sub-sub folders to show in a single list by date order.

My current code:

<ul>
    {{ range .Sections }}
        <li><a href="{{ .RelPermalink }}">{{ .Title }}</a>
            {{ range .Sections }}
                {{ range first 12 .Pages }}
                    <ul>
                        <li><a href="{{ .RelPermalink}}">{{ .Title }}</a></li>
                    </ul>
                {{ end }}
            {{ end }}
        </li>
    {{ end }}
</ul>

This shows the first 12 pages from each sub-sub section. I need to get them all in one list and only show the latest 12 regardless or which sub-sub section they are in

Something like this should work:

{{ range first 12 ( sort (where .Site.RegularPages "Section" "projects") "Date" "desc" ) }}
  {{ . }}
{{ end }}

My folder structure is like this:

projects
— project 1
------- folder 1
---------- content 1
---------- content 2
---------- content 3

------- folder 2
---------- content 4
---------- content 5

------- folder 3
---------- content 6
---------- content 7

— project 2
— project 3

“project 1” should show content 1 - 7 (based on date order) on the list page for “project 1”. It also needs to be dynamic so I can use it for multiple sections