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

Update frontmatter.md #6371

Merged
merged 2 commits into from Sep 22, 2017
Merged

Update frontmatter.md #6371

merged 2 commits into from Sep 22, 2017

Conversation

i-give-up
Copy link
Contributor

Mention that you can set the front-matter variable layout to null if you don't want to use any layout file.

Mention that you can set the front-matter variable `layout` to `null` if you don't want to use any layout file.
@DirtyF
Copy link
Member

DirtyF commented Sep 18, 2017

@i-give-up Thanks for the add, FWIW since 3.5.0 you can also use layout: none with a slightly difference:

Using layout: none will now produce a file with no layout. Equivalent to layout: null, with the exception that none is a truthy value and won't be overwritten by front matter defaults.

Maybe we could also mention this?

@DirtyF DirtyF self-assigned this Sep 18, 2017
@@ -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.
Copy link
Member

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.)

Copy link
Contributor Author

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 documents
  • layout: null for pages

Seems a bit messy.

Copy link
Member

@ashmaroli ashmaroli Sep 18, 2017

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

Copy link
Contributor Author

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 named none.

Copy link
Member

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.
@i-give-up
Copy link
Contributor Author

Ok, made some changes. It's not as pretty as before, but should be a bit more accurate in describing layout: null and layout: none.

Copy link
Member

@DirtyF DirtyF left a 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>
Copy link
Member

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.)

@DirtyF
Copy link
Member

DirtyF commented Sep 22, 2017

@jekylldocs: merge +docs

@jekyllbot jekyllbot merged commit ab31983 into jekyll:master Sep 22, 2017
jekyllbot added a commit that referenced this pull request Sep 22, 2017
@jekyll jekyll locked and limited conversation to collaborators Jul 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants