mkmatter 3.1.4 → 3.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mkmatter/cli/subs/new.rb +7 -1
- data/lib/mkmatter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1079cd5e7d06874dcb351deb2bf4d952be5154f0c368c3c6fbb4a2aa6ce43b11
|
4
|
+
data.tar.gz: 94c6719f08f05ba7d0ec0490447b77e03bba2daee107a6b22eedee945693fe37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee363e847b0e114d67ed29daff4881cbd8217fa15f545bc13677249a24426f46d78ca729c6192598f9220844cddef42eda4d886e4e2f695fc80a8385a7ffa0f6
|
7
|
+
data.tar.gz: 8e8913d45aab3cfb2c33966547b7fcf48e47d84b89d0038587e62f0a9e99ac2aed388dba3f23241d727afa459a31de5075efe25a99347048cbc9a1400625adf6
|
@@ -13,6 +13,7 @@ module Mkmatter
|
|
13
13
|
HILINE = HighLine.new($stdin, $stderr, 40)
|
14
14
|
option :publish, :type => :boolean
|
15
15
|
option :file, :type => :boolean, :default => nil
|
16
|
+
option :index, :type => :boolean, :default => nil
|
16
17
|
method_options %w( template -t ) => :boolean
|
17
18
|
desc 'page [options]', 'make front matter (and possibly content) for a jekyll page'
|
18
19
|
long_desc Mkmatter::App::Descriptions::New::PAGE
|
@@ -22,7 +23,12 @@ module Mkmatter
|
|
22
23
|
if Mkmatter::Methods.check_if_jekyll
|
23
24
|
@questions = Mkmatter::Questions::Page.new(HILINE).ask
|
24
25
|
answers = Mkmatter::Answers.new(@questions, options.fetch(:publish, nil))
|
25
|
-
|
26
|
+
if options.fetch(:index, nil)
|
27
|
+
filename = 'index.' + answers.file_format.downcase
|
28
|
+
else
|
29
|
+
filename = answers.title.to_slug + '.' + answers.file_format.downcase
|
30
|
+
end
|
31
|
+
|
26
32
|
path = Pathname("./#{filename}").realdirpath
|
27
33
|
if HILINE.agree('Would you like to put this page into a subdirectory?', true)
|
28
34
|
HILINE.say("What path? (directories will be created if they don't exist) ")
|
data/lib/mkmatter/version.rb
CHANGED