jekyllpress 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/jp +4 -0
- data/lib/jekyllpress.rb +32 -1
- data/lib/jekyllpress/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 017be71cf20b07221b069939edcd6b57f3c87ff342d2b02968ad216bde0b0dde
|
4
|
+
data.tar.gz: cb1911c10b77f8c7e59605e276822c4f15990b3dc8972db8cee1d7d89cb195f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cd53e1d7dfdb47fe284b95a7d705037c44f53c1f30c8dacda7229bb0fb304e8b35c21710d627fe9ec406890eb0857c96bd0ed3bd8e3e065a91d3dafde6552b3
|
7
|
+
data.tar.gz: 6a75413dd79b946b52057bdf088b5ea6c5b14e2fd965c52731493d1ce9ba4fd4bf65075a894dcd6725dae0d3baeb792e75230b45948353942edaea4f76a21cd0
|
data/bin/jp
ADDED
data/lib/jekyllpress.rb
CHANGED
@@ -31,7 +31,7 @@ module Jekyllpress
|
|
31
31
|
'---
|
32
32
|
layout: <%= @layout %>
|
33
33
|
title: "<%= @title %>"
|
34
|
-
date: <%= @date %>
|
34
|
+
date: <%= @date %>T<%= @time %>
|
35
35
|
categories: <%= Array(@categories) %>
|
36
36
|
tags: <%= Array(@tags) %>
|
37
37
|
source: "<%= @url %>"
|
@@ -78,6 +78,37 @@ module Jekyllpress
|
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
|
+
desc "np TITLE", "Create a new posts with title TITLE"
|
82
|
+
method_option :categories, :desc => "list of categories to assign this post", :type => :array, :aliases => %w[-c]
|
83
|
+
method_option :tags, :desc => "list of tags to assign this post", :type => :array, :aliases => %w[-t]
|
84
|
+
method_option :layout, :desc => "specify an alternate layout for the post", :type => :string, :aliases => %w[-l], :default => "post"
|
85
|
+
method_option :url, :desc => "source URL for blog post", :type => :string
|
86
|
+
method_option :template, :desc => "specify an alternate template to use for the post", :type => :string
|
87
|
+
method_option :date, :desc => "provide an alternate date for the post", :type => :string, :default => Date.today.iso8601
|
88
|
+
method_option :time, :desc => "provide an alternate time of day for the post", :type => :string, :default => Time.now.strftime("%H:%M")
|
89
|
+
method_option :location, :desc => "Location for page to appear in directory", :type => :string, :aliases => %w[-L --loc], :default => nil
|
90
|
+
def np(title="")
|
91
|
+
check_templates
|
92
|
+
@title = title.to_s
|
93
|
+
@title = ask("Title for your post: ") if @title.empty?
|
94
|
+
|
95
|
+
@date = options.fetch("date", Date.today.iso8601)
|
96
|
+
@time = options.fetch("time", Time.now.strftime("%H:%M"))
|
97
|
+
@categories = options.fetch("categories", [])
|
98
|
+
@tags = options.fetch("tags", [])
|
99
|
+
@layout = options[:layout]
|
100
|
+
@url = options[:url]
|
101
|
+
@template = options.fetch("template") { new_post_template }
|
102
|
+
@location = options.fetch("location", posts_dir) || posts_dir
|
103
|
+
|
104
|
+
with_config do |config|
|
105
|
+
check_templates
|
106
|
+
@filename = destination(source, @location, post_filename(@title, @date))
|
107
|
+
template(File.join(template_dir, @template), @filename)
|
108
|
+
[__method__, @title, @date, @time, @filename, @categories, @tags, @layout, @url, @template, @location]
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
81
112
|
desc "new_page TITLE", "Create a new page with title TITLE"
|
82
113
|
method_option :location, :desc => "Location for page to appear in directory", :type => :string, :aliases => %w[-l --loc]
|
83
114
|
method_option :layout, :desc => "specify an alternate layout for the page", :type => :string, :default => "page"
|
data/lib/jekyllpress/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyllpress
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tamara Temple
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -183,6 +183,7 @@ email:
|
|
183
183
|
- tamouse@gmail.com
|
184
184
|
executables:
|
185
185
|
- jekyllpress
|
186
|
+
- jp
|
186
187
|
extensions: []
|
187
188
|
extra_rdoc_files: []
|
188
189
|
files:
|
@@ -196,6 +197,7 @@ files:
|
|
196
197
|
- README.md
|
197
198
|
- Rakefile
|
198
199
|
- bin/jekyllpress
|
200
|
+
- bin/jp
|
199
201
|
- jekyllpress.gemspec
|
200
202
|
- lib/jekyllpress.rb
|
201
203
|
- lib/jekyllpress/version.rb
|