From 1c07f927577e08f81eb76af8b0b83efd0625ec68 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Wed, 31 Oct 2018 19:24:44 +0530 Subject: [PATCH] Update `draft` command to use config from CLI opts --- lib/jekyll/commands/draft.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/jekyll/commands/draft.rb b/lib/jekyll/commands/draft.rb index a9770f9..59a7cf2 100644 --- a/lib/jekyll/commands/draft.rb +++ b/lib/jekyll/commands/draft.rb @@ -33,6 +33,8 @@ def self.process(args = [], options = {}) file_creator = Compose::FileCreator.new(draft, params.force?, params.source) file_creator.create! + + Compose::FileEditor.bootstrap(config) Compose::FileEditor.open_editor(file_creator.file_path) end @@ -46,17 +48,11 @@ def path end def content(custom_front_matter = {}) - default_front_matter = compose_config["draft_default_front_matter"] + default_front_matter = params.config.dig("jekyll_compose", "draft_default_front_matter") custom_front_matter.merge!(default_front_matter) if default_front_matter.is_a?(Hash) super(custom_front_matter) end - - private - - def compose_config - @compose_config ||= Jekyll.configuration["jekyll_compose"] || {} - end end end end