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 explanation of the site front-matter defaults section in site/docs/configuration.md #2439

Merged
merged 3 commits into from May 30, 2014

Conversation

Projects
None yet
4 participants
@tschmidt
Contributor

tschmidt commented May 23, 2014

These documentation changes relate to #2343 and were requested by @parkr. I have added a more detailed explanation of site front-matter defaults as they relate to the page/post front-matter.

in your project.
Instead of repeating this configuration each time you create a new post or page, Jekyll provides
a way to set these defaults in the site front-matter. To do this, you can specify site-wide

This comment has been minimized.

@parkr

parkr May 27, 2014

Member

Let's call this site configuration – we don't have a concept of site front-matter.

{% endhighlight %}
{% highlight yaml %}
# In about/blog/a_post.md

This comment has been minimized.

@parkr

parkr May 27, 2014

Member

Can you please add a YYYY-MM-DD to this filename as well as the _posts dir? Otherwise it's kind of misleading.

This comment has been minimized.

@tschmidt

tschmidt May 27, 2014

Contributor

I'm going to actually change this up a little bit. After re-reading this again, the point I want to make is that it is not just files that are of type post. I am going to use an example where you may have a projects/ folder and any page that is in that path will receive a different layout.

@parkr

This comment has been minimized.

Member

parkr commented May 27, 2014

Excellent work! Thank you so much for putting this together. Just a couple minor changes and we'll be good to go.

category: "project"
{% endhighlight %}
With these defaults, all posts would use the `my-site` layout. Any html files that exist in the `projects/` folder will use the `project` layout. Those files will also have the `page.author`

This comment has been minimized.

@parkr

parkr May 27, 2014

Member

Pages don't necessarily have to be HTML files – they can be markdown, json, textile, etc. Anything that contains the --- that is not a post, is a Page.

defaults:
-
scope:
path: "" # empty string for all files
path: ""

This comment has been minimized.

@parkr

parkr May 27, 2014

Member

maybe add a comment and say # all posts? Is the path here needed when a type is given?

This comment has been minimized.

@tschmidt

tschmidt May 27, 2014

Contributor

The empty string indicates "any file in the project". Adding the type limits it to only files where the file type matches the type specified; in this case posts. Since you can specify that a file is a post in the front-matter - even if it is not in the _posts folder - that configuration would apply to those files as well.

I hope that makes sense.

This comment has been minimized.

@tschmidt

tschmidt May 27, 2014

Contributor

Forgot to answer your second question. Path is always required. Type is optional.

This comment has been minimized.

@parkr

parkr May 27, 2014

Member

Might be good to add that path is required.

This comment has been minimized.

@tschmidt

tschmidt May 28, 2014

Contributor

Cool, will do. I'll try and have a revision sometime tomorrow.

This comment has been minimized.

@parkr

parkr May 28, 2014

Member

Excellent!! Thank you so much!

This comment has been minimized.

@tschmidt

tschmidt May 30, 2014

Contributor

@parkr, Finally got around to making those changes. Let m know if this helps clarify things.

@parkr

This comment has been minimized.

Member

parkr commented May 30, 2014

This is so boss. Thank you!!

parkr added a commit that referenced this pull request May 30, 2014

@parkr parkr merged commit 4e37b51 into jekyll:master May 30, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

parkr added a commit that referenced this pull request May 30, 2014

@tschmidt

This comment has been minimized.

Contributor

tschmidt commented Jun 4, 2014

Glad I could help. Looking forward to this in the next release. Any ideas on when that might happen?

@parkr

This comment has been minimized.

Member

parkr commented Jun 4, 2014

🔜 Need to finish everything on the io-manager branch first.

@tschmidt

This comment has been minimized.

Contributor

tschmidt commented Jun 4, 2014

👍

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.