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
Update frontmatter.md #6371
Update frontmatter.md #6371
Conversation
Mention that you can set the front-matter variable `layout` to `null` if you don't want to use any layout file.
@i-give-up Thanks for the add, FWIW since 3.5.0 you can also use
Maybe we could also mention this? |
docs/_docs/frontmatter.md
Outdated
@@ -65,7 +65,8 @@ front matter of a page or post. | |||
|
|||
If set, this specifies the layout file to use. Use the layout file | |||
name without the file extension. Layout files must be placed in the | |||
<code>_layouts</code> directory. | |||
<code>_layouts</code> directory. Set this to <code>null</code> if you | |||
don't want to use any layout file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The downside to the proposition is that layout: null
will be overridden by frontmatter_defaults
defined in for the document (?) in the config file. As of Jekyll 3.5.x, this is overcome by setting layout: none
in the document. (Works only for Jekyll:Document
objects. For regular Jekyll::Page
objects (like ./about.md
), there's a proposed port via an open PR.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, currently to prevent override by defaults
in _config.yml
, you have to use?
layout: none
for documentslayout: null
for pages
Seems a bit messy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope.. setting layout: none
means it will not be overridden by _config.yml
Currently,
layout: none
for Documents will leave them alone (absolute layout-proof)layout: none
for Pages will display a warning:requested layout 'none' could not be found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know. That's why I said currently you have to use layout: null
for pages. If you use layout: none
for pages it'll try to use a layout named none
.
So to summarize
- Using
layout: null
will produce a file without layout file, but this will be overridden if the file is a Document and has a layout defined in front matter defaults. - (version 3.5.0 and above) Using
layout: none
in a Document produce a file without a layout file. If used in a Page, it will try to use a layout namednone
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that is 99.99% correct.. 😃 If things go as I hope, v3.6.0
might land with layout: none
applicable to Pages as well..
Describe the behavior of `layout: null` and `layout: none` in various filetypes and scenarios.
Ok, made some changes. It's not as pretty as before, but should be a bit more accurate in describing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Things are a bit messy at the moment. We should revisit this after 3.6.0.
Thanks for taking care of the documentation @i-give-up
|
||
</p> | ||
<ul> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: tbody td ul
font-size is currently not the same as tbody td p
elements. This should be taken care of in another PR. (or just limit ourselves to p
tags in tables.)
@jekylldocs: merge +docs |
Mention that you can set the front-matter variable
layout
tonull
if you don't want to use any layout file.