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

Conversation

@i-give-up
Copy link
Contributor

i-give-up commented Sep 18, 2017

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

This comment has been minimized.

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.

This comment has been minimized.

Copy link
@ashmaroli

ashmaroli Sep 18, 2017

Member

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

This comment has been minimized.

Copy link
@i-give-up

i-give-up Sep 18, 2017

Author Contributor

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.

This comment has been minimized.

Copy link
@ashmaroli

ashmaroli Sep 18, 2017

Member

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

This comment has been minimized.

Copy link
@i-give-up

i-give-up Sep 18, 2017

Author Contributor

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.

This comment has been minimized.

Copy link
@ashmaroli

ashmaroli Sep 18, 2017

Member

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

This comment has been minimized.

Copy link
Contributor Author

i-give-up commented Sep 18, 2017

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.

@DirtyF
DirtyF approved these changes Sep 18, 2017
Copy link
Member

DirtyF left a comment

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>

This comment has been minimized.

Copy link
@DirtyF

DirtyF Sep 18, 2017

Member

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

This comment has been minimized.

Copy link
Member

DirtyF commented Sep 22, 2017

@jekylldocs: merge +docs

@jekyllbot jekyllbot merged commit ab31983 into jekyll:master Sep 22, 2017
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
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
4 participants
You can’t perform that action at this time.