Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

Conversation

@tditiecher
Copy link
Contributor

Functionality is based on:
https://jekyllrb.com/docs/configuration/#front-matter-defaults

Resolves #305

Note: I removed adding a fixed date of '2012-01-01' to the dictionary if
not specified in the _config.yml. It was never used.

Functionality is based on:
https://jekyllrb.com/docs/configuration/#front-matter-defaults

Issue: #305

Note: I removed adding a fixed date of '2012-01-01' to the dictionary if
not specified in the _config.yml. It was never used.

public IDefaultsConfiguration GetDefaults()
{
return new DefaultsConfiguration(_config);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is used with the site configuration, is it really necessary to instantiate a new defaults each time?

@laedit
Copy link
Contributor

laedit commented Jul 13, 2016

Thanks a lot, you are awesome! 😃
I've wanted to do that since months but never find the time to do it.
I just have a couple remarks before merging.


Assert.Equal("default-author", defaults["author"]);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test which check that values in page/post's front matter have priority against defaults?

Moved DefaultsConfiguration to its own file.
Converted GetDefaults() method to a property.

Fixes #305
@laedit
Copy link
Contributor

laedit commented Jul 13, 2016

Excellent, thanks!

@laedit laedit merged commit d3b3aa3 into Code52:master Jul 13, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Defining defaults for layout in _config.yml

2 participants