From 37355c562f08ba3a3848b11db1cdad7ef93cc656 Mon Sep 17 00:00:00 2001 From: toshimaru Date: Mon, 8 Oct 2018 00:45:19 +0900 Subject: [PATCH] merge post_default_front_matter config setting --- lib/jekyll/commands/post.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/jekyll/commands/post.rb b/lib/jekyll/commands/post.rb index 1e341f4..99a804a 100644 --- a/lib/jekyll/commands/post.rb +++ b/lib/jekyll/commands/post.rb @@ -64,12 +64,17 @@ def _time_stamp end def content(custom_front_matter = {}) + if jekyll_compose_config && jekyll_compose_config["post_default_front_matter"] + custom_front_matter.merge!(jekyll_compose_config["post_default_front_matter"]) + end + super({ "date" => _time_stamp }.merge(custom_front_matter)) end - def content - post_front_matter = Jekyll.configuration["post_front_matter"] - post_front_matter ? super(post_front_matter) : super + private + + def jekyll_compose_config + @jekyll_compose_config ||= Jekyll.configuration["jekyll_compose"] end end end