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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/_docs/frontmatter.md
Expand Up @@ -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..


</p>
</td>
Expand Down