Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested layouts treat first layout as the page #127

Open
kslstn opened this issue Sep 14, 2023 · 0 comments
Open

Nested layouts treat first layout as the page #127

kslstn opened this issue Sep 14, 2023 · 0 comments

Comments

@kslstn
Copy link

kslstn commented Sep 14, 2023

I love the flexibility this plugin offers and I hope I can use it for our website!

One real problem I found so far though. Our layouts are nested, roughly something like:

Page, contains layout: specific
/_layouts/specific.html: contains layout: general and show_banner: false
/_layouts/general.html

In general.html we check frontmatter properties from the specific layout like {% unless layout.show_banner == false %}.

With pages that are created by the data page generator, such a check no longer works. However, I can access the value via page.show_banner! The workaround would be to update the various levels of nesting with the properties in the layout we're using for the data-generated pages. Then the check would be % unless layout.show_banner == false or page.show_banner == false %}.

As I'm not looking forward to adding that extra check, I'm wondering, is this behavior intentional and reliable? is this perhaps just how Jekyll works, like "the highest level must be a page, even if there's no file for it"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant