jekyll-page-boilerplate 4.0.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/jekyll_page_boilerplate/msg/description.md +29 -0
- data/lib/jekyll_page_boilerplate/msg.rb +11 -1
- data/lib/jekyll_page_boilerplate/page.rb +3 -3
- data/lib/jekyll_page_boilerplate/version.rb +1 -3
- data/lib/jekyll_page_boilerplate.rb +1 -1
- data/lib/jekyll_page_boilerplate_cli.rb +10 -14
- metadata +17 -5
- data/lib/jekyll_page_boilerplate/msg/readme.md +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0e902f15da76660bca40905d596f95cc1ab1f6f3f3f1e6533d38d1e219b05e6
|
4
|
+
data.tar.gz: 71a26b39978a7f26252e95f99caf0e1dda7a8b4f72ebe57637afa5a5eca040f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d5a7e96cdc2b999749603d9c8dcda141b49e7b2230dc5ae2871cab22eff97b29f309320d69777ba9c9c5287b477bcf2847a9c14c9b235d150049215b0d1fe04
|
7
|
+
data.tar.gz: 3182cf46a90cf0d0ffe94ba6120eee236a5ec6d897cba09dc702fcd5a8b8cf300ab2a28e0dd8ae47e422608bf43f56f22cce2595e91b045c17f82f4a4532033b
|
@@ -0,0 +1,29 @@
|
|
1
|
+
A boilerplate is a markdown file you place under the `_boilerplates` folder to generate new pages for jekyll.
|
2
|
+
|
3
|
+
`_boilerplates/post.md`
|
4
|
+
|
5
|
+
---
|
6
|
+
_boilerplate: # boilerplate settings
|
7
|
+
path: _posts # the path to create the new page under.
|
8
|
+
timestamp: true # when true new post/pages will include the date in the filename.
|
9
|
+
title: {{ boilerplate.title }} # tags like this will be replaced
|
10
|
+
layout: post # everthing else will be copied to the new post.
|
11
|
+
author: John Doe
|
12
|
+
|
13
|
+
|
14
|
+
`$ boilerplate post -T "Another one about pottery"` would create a new file `_posts/yyyy-mm-dd-another-one-about-pottery.markdown`
|
15
|
+
|
16
|
+
---
|
17
|
+
title: Another one about pottery
|
18
|
+
created: 'yyyy-mm-dd hh:mm:ss -0000'
|
19
|
+
layout: post
|
20
|
+
author: John Doe
|
21
|
+
|
22
|
+
|
23
|
+
Available Tags `{{ boilerplate.xxx }}`:
|
24
|
+
- `.title`, `.name`
|
25
|
+
- `.path`, `.file`, `.suffix`
|
26
|
+
- `.time`, `.date`, `.timestamp`
|
27
|
+
- `.random_url`
|
28
|
+
- Custom tags you provide in the command `bplate post custom=1`
|
29
|
+
- And anything you put under the `_boilerplate:` header
|
@@ -1,8 +1,18 @@
|
|
1
1
|
|
2
2
|
module JekyllPageBoilerplate::Msg
|
3
3
|
|
4
|
+
SUMMARY = "A jekyll plugin that allows you to create new pages or posts from a boilerplate through the terminal."
|
5
|
+
|
4
6
|
def self.file name
|
5
|
-
puts
|
7
|
+
puts self.read_file name
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.description
|
11
|
+
self.read_file('description.md')
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.read_file name
|
15
|
+
File.read(File.join(__dir__, 'msg', name))
|
6
16
|
end
|
7
17
|
|
8
18
|
def self.error(**msgs)
|
@@ -21,7 +21,7 @@ class JekyllPageBoilerplate::Page
|
|
21
21
|
|
22
22
|
def initialize boilerplate, options
|
23
23
|
options.compact!
|
24
|
-
options.transform_keys!
|
24
|
+
options.transform_keys!(&:to_s)
|
25
25
|
plate_path = get_boilerplate_path(boilerplate).to_s
|
26
26
|
|
27
27
|
abort_unless_file_exists( plate_path )
|
@@ -82,8 +82,8 @@ class JekyllPageBoilerplate::Page
|
|
82
82
|
|
83
83
|
class Tag
|
84
84
|
class << self
|
85
|
-
def
|
86
|
-
|
85
|
+
def method_missing *args
|
86
|
+
''
|
87
87
|
end
|
88
88
|
|
89
89
|
def random_url length = nil
|
@@ -3,8 +3,8 @@ require 'jekyll_page_boilerplate'
|
|
3
3
|
|
4
4
|
class JekyllPageBoilerplate::Application < Bales::Application
|
5
5
|
version JekyllPageBoilerplate::VERSION
|
6
|
-
description JekyllPageBoilerplate::
|
7
|
-
|
6
|
+
description JekyllPageBoilerplate::Msg.description
|
7
|
+
summary JekyllPageBoilerplate::Msg::SUMMARY
|
8
8
|
# `boilerplate <page>`
|
9
9
|
option :title, type: String, long_form: '--title', short_form: '-T',
|
10
10
|
description: "`path/<title>.md`"
|
@@ -15,16 +15,12 @@ class JekyllPageBoilerplate::Application < Bales::Application
|
|
15
15
|
option :suffix, type: String, long_form: '--suffix', short_form: '-x',
|
16
16
|
description: "`path/title.<md, markdown, txt>`"
|
17
17
|
|
18
|
-
action do |plate, title: nil, path: nil, timestamp: nil, suffix: nil|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
description "Helpful info"
|
25
|
-
action do
|
26
|
-
JekyllPageBoilerplate.readme
|
27
|
-
end
|
18
|
+
action do |plate, *custom, title: nil, path: nil, timestamp: nil, suffix: nil|
|
19
|
+
custom = Hash[custom.map {|v| v.split('=')}]
|
20
|
+
JekyllPageBoilerplate.page plate, custom.merge({
|
21
|
+
title: title, path: path,
|
22
|
+
suffix: suffix, timestamp: timestamp
|
23
|
+
})
|
28
24
|
end
|
29
25
|
|
30
26
|
# `boilerplate help`
|
@@ -32,7 +28,7 @@ class JekyllPageBoilerplate::Application < Bales::Application
|
|
32
28
|
|
33
29
|
# `boilerplate init`
|
34
30
|
command 'init' do
|
35
|
-
|
31
|
+
summary "Creates an example boilerplate."
|
36
32
|
action do
|
37
33
|
JekyllPageBoilerplate.init
|
38
34
|
end
|
@@ -40,7 +36,7 @@ class JekyllPageBoilerplate::Application < Bales::Application
|
|
40
36
|
|
41
37
|
# `boilerplate list`
|
42
38
|
command 'list' do
|
43
|
-
|
39
|
+
summary "List all the boilerplates"
|
44
40
|
action do
|
45
41
|
JekyllPageBoilerplate.list
|
46
42
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-page-boilerplate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Ferney
|
@@ -44,8 +44,19 @@ dependencies:
|
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 2.8.5
|
47
|
-
description: A
|
48
|
-
|
47
|
+
description: "A boilerplate is a markdown file you place under the `_boilerplates`
|
48
|
+
folder to generate new pages for jekyll.\n\n`_boilerplates/post.md`\n\n ---\n
|
49
|
+
\ _boilerplate: # boilerplate settings\n path: _posts # the path
|
50
|
+
to create the new page under.\n timestamp: true # when true new post/pages
|
51
|
+
will include the date in the filename. \n title: {{ boilerplate.title }} # tags
|
52
|
+
like this will be replaced\n layout: post # everthing else will be copied
|
53
|
+
to the new post.\n author: John Doe\n\n\n`$ boilerplate post -T \"Another one
|
54
|
+
about pottery\"` would create a new file `_posts/yyyy-mm-dd-another-one-about-pottery.markdown`\n\n
|
55
|
+
\ ---\n title: Another one about pottery\n created: 'yyyy-mm-dd hh:mm:ss
|
56
|
+
-0000'\n layout: post\n author: John Doe\n\n\nAvailable Tags `{{ boilerplate.xxx
|
57
|
+
}}`:\n- `.title`, `.name`\n- `.path`, `.file`, `.suffix`\n- `.time`, `.date`, `.timestamp`\n-
|
58
|
+
`.random_url`\n- Custom tags you provide in the command `bplate post custom=1`\n-
|
59
|
+
And anything you put under the `_boilerplate:` header\n"
|
49
60
|
email:
|
50
61
|
- sean@codekarma.dev
|
51
62
|
executables:
|
@@ -61,7 +72,7 @@ files:
|
|
61
72
|
- lib/jekyll_page_boilerplate/init.rb
|
62
73
|
- lib/jekyll_page_boilerplate/list.rb
|
63
74
|
- lib/jekyll_page_boilerplate/msg.rb
|
64
|
-
- lib/jekyll_page_boilerplate/msg/
|
75
|
+
- lib/jekyll_page_boilerplate/msg/description.md
|
65
76
|
- lib/jekyll_page_boilerplate/page.rb
|
66
77
|
- lib/jekyll_page_boilerplate/version.rb
|
67
78
|
- lib/jekyll_page_boilerplate_cli.rb
|
@@ -89,5 +100,6 @@ requirements: []
|
|
89
100
|
rubygems_version: 3.2.3
|
90
101
|
signing_key:
|
91
102
|
specification_version: 4
|
92
|
-
summary: A jekyll plugin that
|
103
|
+
summary: A jekyll plugin that allows you to create new pages or posts from a boilerplate
|
104
|
+
through the terminal.
|
93
105
|
test_files: []
|
@@ -1,30 +0,0 @@
|
|
1
|
-
A boilerplate is a markdown file in the `_boilerplates` folder.
|
2
|
-
|
3
|
-
ie. `_boilerplates/post.md`
|
4
|
-
---
|
5
|
-
_boilerplate: # boilerplate settings
|
6
|
-
path: _posts # the path to create the new page under.
|
7
|
-
timestap: true # when true new post/pages will include the date in the filename.
|
8
|
-
|
9
|
-
title: {{ boilerplate.title }}
|
10
|
-
layout: post # everthing else will be copied to the new post.
|
11
|
-
author: John Doe
|
12
|
-
|
13
|
-
`$ boilerplate post -T "Another one about pottery"` would create a new file `_posts/yyyy-mm-dd-another-one-about-pottery.markdown`
|
14
|
-
---
|
15
|
-
title: Another one about pottery
|
16
|
-
created: 'yyyy-mm-dd hh:mm:ss -0000'
|
17
|
-
layout: post
|
18
|
-
author: John Doe
|
19
|
-
---
|
20
|
-
|
21
|
-
Available Tags with `{{ boilerplate.xxx }}`:
|
22
|
-
- `.title`, `.name`
|
23
|
-
- `.path`, `.file`, `.suffix`
|
24
|
-
- `.time`, `.date`, `.timestamp`
|
25
|
-
- `.random_url`
|
26
|
-
- And anything you put under the `_boilerplate:` header
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
Use `boilerplate help` for more details
|