File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed
Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,13 @@ def self.init_with_program(prog)
1919 def self . process ( args = [ ] , options = { } )
2020 raise ArgumentError . new ( 'You must specify a name.' ) if args . empty?
2121
22+ <<<<<<< HEAD
2223 type = options [ "type" ] || "md"
2324 layout = options [ "layout" ] || "post"
25+ =======
26+ type = options [ "type" ] . nil? ? Jekyll ::Compose ::DEFAULT_TYPE : options [ "type" ]
27+ layout = options [ "layout" ] . nil? ? Jekyll ::Compose ::DEFAULT_LAYOUT : options [ "layout" ]
28+ >>>>>>> move type and layout values to contants
2429
2530 title = args . shift
2631 name = title . gsub ( ' ' , '-' ) . downcase
@@ -38,7 +43,7 @@ def self.process(args = [], options = {})
3843 # Internal: Gets the filename of the draft to be created
3944 #
4045 # Returns the filename of the draft, as a String
41- def self . draft_name ( name , ext = 'md' )
46+ def self . draft_name ( name , ext = Jekyll :: Compose :: DEFAULT_TYPE )
4247 "_drafts/#{ name } .#{ ext } "
4348 end
4449
Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ def self.init_with_program(prog)
2020 def self . process ( args = [ ] , options = { } )
2121 raise ArgumentError . new ( 'You must specify a name.' ) if args . empty?
2222
23- type = options [ "type" ] . nil? ? "md" : options [ "type" ]
24- layout = options [ "layout" ] . nil? ? "post" : options [ "layout" ]
23+ type = options [ "type" ] . nil? ? Jekyll :: Compose :: DEFAULT_TYPE : options [ "type" ]
24+ layout = options [ "layout" ] . nil? ? Jekyll :: Compose :: DEFAULT_LAYOUT : options [ "layout" ]
2525
2626 date = options [ "date" ] . nil? ? Time . now : DateTime . parse ( options [ "date" ] )
2727
Original file line number Diff line number Diff line change 1+ require "jekyll/compose/version"
2+
3+ module Jekyll
4+ module Compose
5+ DEFAULT_TYPE = "md"
6+ DEFAULT_LAYOUT = "post"
7+ end
8+ end
9+
10+ require "jekyll/commands/draft"
11+ require "jekyll/commands/post"
12+ require "jekyll/commands/publish"
You can’t perform that action at this time.
0 commit comments