lib/mkmatter/cli/subs/new.rb in mkmatter-3.0.44 vs lib/mkmatter/cli/subs/new.rb in mkmatter-3.0.45
- old
+ new
@@ -41,19 +41,21 @@
exit 1
end
path = Pathname(folder).realdirpath.join(filename)
end
File.open(path.to_path, 'a') do |fd|
+ answers.to_h = {'layout' => 'page'}
fd.puts answers.to_h.stringify_keys.to_yaml(indentation: 2)
fd.puts '---'
end
Mkmatter::Methods.launch_editor(options[:editor], path)
else
puts "Not in a Jekyll directory. (no '_config.yml' in any parent directory)"
exit 1
end
else
+ @questions = Mkmatter::Questions::Page.new(HILINE).ask
answers = Mkmatter::Answers.new(@questions, options.fetch(:publish, nil))
puts ''
puts answers.to_h.stringify_keys.to_yaml(indentation: 2)
puts '---'
end
@@ -94,10 +96,11 @@
exit 1
end
path = Pathname(folder).realdirpath.join(filename)
end
File.open(path.to_path, 'a') do |fd|
+ answers.to_h = {'layout' => 'post'}
fd.puts answers.to_h.stringify_keys.to_yaml(indentation: 2)
fd.puts '---'
end
Mkmatter::Methods.launch_editor(options[:editor], path)
else
@@ -131,9 +134,10 @@
exit 1
end
path = Pathname(folder).realdirpath.join(filename)
end
File.open(path.to_path, 'a') do |fd|
+ answers.to_h = {'layout' => 'post'}
fd.puts answers.to_h.stringify_keys.to_yaml(indentation: 2)
fd.puts '---'
end
Mkmatter::Methods.launch_editor(options[:editor], path)
\ No newline at end of file