Skip to content

Commit

Permalink
Update draft command to use config from CLI opts
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmaroli committed Oct 31, 2018
1 parent bf68687 commit 1c07f92
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/jekyll/commands/draft.rb
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 1c07f92

Please sign in to comment.