Skip to content

Layout lookup should consider root and current section's type if set #4891

@bep

Description

@bep

You can currently set

type: pretty
layout: two-colums

In every content page, list and single pages. Which makes it flexible. But if you take the base layouts into account, it is hard to create a couple of reusable templates that can be applied to new sections on demand (without creating duplicates):

If I set this in news/_index.md:

type: "3-column"

Then I want that type to be in the template lookup order (before the most general ones) for both that section and other pages in that section.

This means that if I create news/article.md I don't have to do something extra to get that "3-column" layout.

This behaviour matches what we do with the section today, but this will make it more flexible.

So we add

  • The current section's type if set
  • The root section's type if set

In that order.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions