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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7297a31cc22106ee8c0a96e9e98b33a3d20a71237d7b9fc76362cd770a37e0f
4
- data.tar.gz: 3e6a25b13b0b346286453f855cab87f95724edc17fb94f645b85435e41fa9d16
3
+ metadata.gz: 1079cd5e7d06874dcb351deb2bf4d952be5154f0c368c3c6fbb4a2aa6ce43b11
4
+ data.tar.gz: 94c6719f08f05ba7d0ec0490447b77e03bba2daee107a6b22eedee945693fe37
5
5
  SHA512:
6
- metadata.gz: a10f600272b9f40d243719c2ecbaf850996451085addf1f523b4c6bce83a8806ddeaf439a7a0be56d3b30875911958ee824365432182be286832ef665a3b284f
7
- data.tar.gz: d96cc54c16ee98daab9df40f730dc14b8918710ea9ba899ef0f3f020a2246f30c6dbbfd084cf69dba053a1530fd3f4c87f45264411bd607f540f4df78083b740
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
- filename = answers.title.to_slug + '.' + answers.file_format.downcase
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) ")
@@ -1,3 +1,3 @@
1
1
  module Mkmatter
2
- VERSION = '3.1.4'
2
+ VERSION = '3.1.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mkmatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.4
4
+ version: 3.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Spencer