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

Added support for specifying frontmatter defaults in _config.yml #306

Merged
merged 2 commits into from
Jul 13, 2016
Merged

Added support for specifying frontmatter defaults in _config.yml #306

merged 2 commits into from
Jul 13, 2016

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
Member

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
Member

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
Member

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
Member

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