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

feat: Allow no layout when a default layout is defined #159

Closed
wout opened this issue Oct 3, 2020 · 4 comments · Fixed by #163
Closed

feat: Allow no layout when a default layout is defined #159

wout opened this issue Oct 3, 2020 · 4 comments · Fixed by #163
Labels
bug Something isn't working

Comments

@wout
Copy link
Contributor

wout commented Oct 3, 2020

Summary

When using a default layout, there should be a way to define "no layout".

Reference-level explanation

We're using a default global layout with the following configuration:

-
    scope:
      path: ""
    values:
      layout: "default"

That's great because it eliminates the need to define the same layout everywhere. But there are some edge cases where no layout is required at all. For example, an RSS feed or a sitemap. We now have two workarounds. One is a layout called feed.liquid with just the following contents:

{{ content }}

Another is to have layout: false in the front matter. Although, the latter adds the following warning to the logs:

[Bridgetown]      Build Warning: Layout 'false' requested in sitemap.xml does not exist.

So it's a hack, really.

Solution

Both options work, but allowing to configure layout: false in the front matter solves the issue.

@KonnorRogers
Copy link
Member

KonnorRogers commented Oct 3, 2020

@wout Out of curiosity, what warnings do you get with layout: null

Jekyll issues seems to say layout: null is the preferred syntax.

jekyll/jekyll#2730

@wout
Copy link
Contributor Author

wout commented Oct 3, 2020

The result for sitemap.xml:

image

That's because it considers false as a layout (e.g. false.liquid) and null as "no layout defined", so it uses the default.

@KonnorRogers KonnorRogers added the bug Something isn't working label Oct 3, 2020
@jaredcwhite
Copy link
Member

I'm thinking layout: none is supported but I should test this out a bit more.

@jaredcwhite jaredcwhite added this to the 0.18.0 "Taylor Street" milestone Oct 18, 2020
@wout
Copy link
Contributor Author

wout commented Oct 19, 2020

Just checked and it is. Thanks!

But maybe it's a good idea to include false as well as an option. Because none isn't an intuitive value, from my point of view at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants