Confused by lookup order - multiple identifiers?

I’m trying to understand the new template lookup order and not much I’m trying is working. I was hoping I could do something like:

  • layouts/
    • single.html
    • list.html
    • single.myLayout.html
    • list.myLayout.html

And then cascade layout in a few different sections across my site, but it’s not working. Everything is just using the basic templates (list.html and single.html). I was also surprised to note that if I remove “list.html” everything starts using "list.myLayout.html` regardless of where it is or what the frontmatter layout is set to.

I must be misunderstanding how multiple identifiers are intended to be used. I’ve also played around with changing the order of the identifiers, like myLayout.list.html.

To (hopefully) be clear, I was expecting that everything in sectionAA would use either list.mySection.html or single.mySection.html:

  • content/sectionA/
    - _index.md # should use list.html
    • sectionAA/
      • _index.html # set cascade.layout to “myLayout” (verified it’s working by adding {{ .Layout }} to my baseof.html
      • page1.md # set layout: myLayout
      • page2.md

Moving the myLayout layouts to layouts/sectionA/sectionAA/{single,list}.html might work, except that I also want to use them in other random sections around the site.

Without spending any time digging into this, the first thing I noticed was mixed-case layout names. What happens if you use lower case for everything?

No effect

Ok, I think a lot of my confusion might have been caused by the fact that the theme I’m using is using the old template locations under “_default”. If I copy it’s “_default/single.html” into my “layouts/single.html” and then use “myLayout.single.html” instead of “single.myLayout.html” it’s working how I would expect.

Nevermind. I hadn’t added “list.myLayout.html” yet, which breaks it by trying to apply it to regular pages with a “myLayout” layout.

I think the new layout system is a lot simpler, no? You need a template for a page - create page.html, you need layout for a section - create section.html, etc.

For custom layouts, I think you can just create a custom named layout like customlayout.html, then in the front matter set something like layout: customlayout.html.

Why do you ever want now to use single/list.html files instead of page/section.html files?