octopress 3.0.0.rc.27 → 3.0.0.rc.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -3
- data/README.md +17 -5
- data/lib/octopress/commands/helpers.rb +4 -4
- data/lib/octopress/commands/init.rb +1 -1
- data/lib/octopress/commands/isolate.rb +2 -2
- data/lib/octopress/commands/new.rb +28 -12
- data/lib/octopress/page.rb +1 -1
- data/lib/octopress/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19962f7013c2826d4225761b535f04c51c304ce7
|
4
|
+
data.tar.gz: d4291418217bf31b93b8a5b2b344b5d21ff7e42f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 361196b074235495103e8f0422f4c73db8b132bf8a2242d9fa1774c69d589637ed3bdf79fa0baa3192242346ddf9a5336f31b617e7f67e00cb3162eb53891845
|
7
|
+
data.tar.gz: 2fbdc312f1b0d38462f736b1954e1b92ca1b0c22a1c394b3a3212ffad929f57e318597901d5a93dd9edfe1f6f8ea6dc76e629808721683d748e70cd32c450a1e
|
data/CHANGELOG.md
CHANGED
@@ -1,17 +1,22 @@
|
|
1
1
|
# Octopress Changelog
|
2
2
|
|
3
|
-
### 3.0.0 RC27 (2015-01-
|
3
|
+
### 3.0.0 RC27 (2015-01-15)
|
4
|
+
|
5
|
+
- Fix: `--template` option accepts a path, allowing shell auto-completion.
|
6
|
+
- Added short option flags for most commands.
|
7
|
+
|
8
|
+
### 3.0.0 RC27 (2015-01-15)
|
4
9
|
|
5
10
|
- Minor fix to paths.
|
6
11
|
- Improved scaffold command output.
|
7
12
|
- Fixed drafts template config.
|
8
13
|
- Added config documentation for template file configs.
|
9
14
|
|
10
|
-
### 3.0.0 RC26 (2015-01-
|
15
|
+
### 3.0.0 RC26 (2015-01-11)
|
11
16
|
|
12
17
|
- Added `unpublish` command for converting posts into drafts.
|
13
18
|
|
14
|
-
### 3.0.0 RC25 (2015-01-
|
19
|
+
### 3.0.0 RC25 (2015-01-05)
|
15
20
|
|
16
21
|
- Fixed missing scaffolding.
|
17
22
|
|
data/README.md
CHANGED
@@ -31,7 +31,7 @@ new page <PATH> # Add a new page to your site
|
|
31
31
|
new draft <TITLE> # Add a new draft post to your site
|
32
32
|
publish <POST> # Publish a draft from _drafts to _posts
|
33
33
|
unpublish <POST> # Search for a post and convert it into a draft
|
34
|
-
isolate [POST] # Stash all posts but the one you're
|
34
|
+
isolate [POST] # Stash all posts but the one you're working on for a faster build
|
35
35
|
integrate # Restores all posts, doing the opposite of the isolate command
|
36
36
|
```
|
37
37
|
|
@@ -125,7 +125,7 @@ $ octopress new draft "My Title"
|
|
125
125
|
| `--template PATH` | Use a template from <path> |
|
126
126
|
| `--date DATE` | The date for the draft. Should be parseable by [Time#parse](http://ruby-doc.org/stdlib-2.1.0/libdoc/time/rdoc/Time.html#method-i-parse) (defaults to Time.now) |
|
127
127
|
| `--slug SLUG` | The slug for the new post. |
|
128
|
-
| `--force` | Overwrite
|
128
|
+
| `--force` | Overwrite existing file. |
|
129
129
|
|
130
130
|
### Publish a draft
|
131
131
|
|
@@ -187,13 +187,25 @@ a handful of local variables you can use when working with templates.
|
|
187
187
|
| `day` | The date's day, DD |
|
188
188
|
|
189
189
|
By default Octopress has templates for pages, posts and drafts. You can change them or create new ones for different types of content.
|
190
|
-
To create linkposts template, add a file at `_templates/linkpost
|
190
|
+
To create linkposts template, add a file at `_templates/linkpost`, such as:
|
191
|
+
|
192
|
+
```
|
193
|
+
---
|
194
|
+
title: {{ title }}
|
195
|
+
external-url: {{ url }}
|
196
|
+
---
|
197
|
+
```
|
198
|
+
|
199
|
+
Then you can use it with a new post like this:
|
191
200
|
|
192
201
|
```sh
|
193
|
-
$ octopress new post --template
|
202
|
+
$ octopress new post "Some title" --template linkpost
|
203
|
+
$ octopress new post "Some title" -tm _templates/linkpost
|
194
204
|
```
|
195
205
|
|
196
|
-
|
206
|
+
In the second example, I'm passing the full template file path. This way I can use my shell's tab to auto-complete feature.
|
207
|
+
|
208
|
+
When creating templates, file name extensions are unnecessary since the files are just plain text anyway.
|
197
209
|
|
198
210
|
## Isolate
|
199
211
|
|
@@ -3,13 +3,13 @@ module Octopress
|
|
3
3
|
extend self
|
4
4
|
|
5
5
|
def add_page_options(c)
|
6
|
-
c.option 'template', '--template PATH', "New #{c.name.to_s} from a template."
|
7
|
-
c.option 'date', '--date DATE', "Use 'now' or a String that is parseable by Time#parse."
|
8
|
-
c.option 'force', '--force', 'Overwrite file if it already exists'
|
6
|
+
c.option 'template', '-tm', '--template PATH', "New #{c.name.to_s} from a template."
|
7
|
+
c.option 'date', '-d', '--date DATE', "Use 'now' or a String that is parseable by Time#parse."
|
8
|
+
c.option 'force', '-f', '--force', 'Overwrite file if it already exists'
|
9
9
|
end
|
10
10
|
|
11
11
|
def add_common_options(c)
|
12
|
-
c.option 'config', '--config <CONFIG_FILE>[,CONFIG_FILE2,...]', Array, 'Custom Jekyll configuration file'
|
12
|
+
c.option 'config', '-c', '--config <CONFIG_FILE>[,CONFIG_FILE2,...]', Array, 'Custom Jekyll configuration file'
|
13
13
|
end
|
14
14
|
|
15
15
|
def select_posts(search, action)
|
@@ -4,7 +4,7 @@ module Octopress
|
|
4
4
|
p.command(:init) do |c|
|
5
5
|
c.syntax 'init <PATH> [options]'
|
6
6
|
c.description "Add Octopress's default scaffolding to your site."
|
7
|
-
c.option 'force', '--force', 'Overwrite files if they already exist.'
|
7
|
+
c.option 'force', '-f', '--force', 'Overwrite files if they already exist.'
|
8
8
|
|
9
9
|
c.action do |args, options|
|
10
10
|
Scaffold.new(args, options).write
|
@@ -4,7 +4,7 @@ module Octopress
|
|
4
4
|
def self.init_with_program(p)
|
5
5
|
p.command(:isolate) do |c|
|
6
6
|
c.syntax 'isolate <POST> [options]'
|
7
|
-
c.description "Move all posts not matching selected
|
7
|
+
c.description "Move all posts not matching selected post to _posts/_exile. Command accepts path to post or search string."
|
8
8
|
CommandHelpers.add_common_options c
|
9
9
|
|
10
10
|
c.action do |args, options|
|
@@ -21,7 +21,7 @@ module Octopress
|
|
21
21
|
p.command(:integrate) do |c|
|
22
22
|
c.syntax 'integrate'
|
23
23
|
c.description "Reintegrate posts from _posts/_exile."
|
24
|
-
|
24
|
+
CommandHelpers.add_common_options c
|
25
25
|
|
26
26
|
c.action do |args, options|
|
27
27
|
integrate_posts(options)
|
@@ -4,12 +4,13 @@ module Octopress
|
|
4
4
|
p.command(:new) do |c|
|
5
5
|
c.syntax 'new <PATH>'
|
6
6
|
c.description 'Creates a new site with Jekyll and Octopress scaffolding at the specified path.'
|
7
|
-
c.option 'force', '--force', 'Force creation even if path already exists.'
|
8
|
-
c.option 'blank', '--blank', 'Creates scaffolding but with empty files.'
|
7
|
+
c.option 'force', '-f', '--force', 'Force creation even if path already exists.'
|
8
|
+
c.option 'blank', '-b', '--blank', 'Creates scaffolding but with empty files.'
|
9
9
|
|
10
10
|
c.action do |args, options|
|
11
11
|
if args.empty?
|
12
12
|
c.logger.error "You must specify a path."
|
13
|
+
puts c
|
13
14
|
else
|
14
15
|
Jekyll::Commands::New.process(args, options)
|
15
16
|
Octopress::Scaffold.new(args, options).write
|
@@ -19,13 +20,18 @@ module Octopress
|
|
19
20
|
c.command(:page) do |c|
|
20
21
|
c.syntax 'page <PATH> [options]'
|
21
22
|
c.description 'Add a new page to your Jekyll site.'
|
22
|
-
c.option 'title', '--title TITLE', 'String to be added as the title in the YAML front-matter.'
|
23
|
+
c.option 'title', '-t', '--title TITLE', 'String to be added as the title in the YAML front-matter.'
|
23
24
|
CommandHelpers.add_page_options c
|
24
25
|
CommandHelpers.add_common_options c
|
25
26
|
|
26
27
|
c.action do |args, options|
|
27
|
-
|
28
|
-
|
28
|
+
if args.empty?
|
29
|
+
c.logger.error "Plese choose a path"
|
30
|
+
puts c
|
31
|
+
else
|
32
|
+
options['path'] = args.first
|
33
|
+
Page.new(Octopress.site(options), options).write
|
34
|
+
end
|
29
35
|
end
|
30
36
|
end
|
31
37
|
|
@@ -33,13 +39,18 @@ module Octopress
|
|
33
39
|
c.syntax 'post <TITLE> [options]'
|
34
40
|
c.description 'Add a new post to your Jekyll site.'
|
35
41
|
CommandHelpers.add_page_options c
|
36
|
-
c.option 'slug', '--slug SLUG', 'Use this slug in filename instead of sluggified post title.'
|
37
|
-
c.option 'dir', '--dir DIR', 'Create post at _posts/DIR/.'
|
42
|
+
c.option 'slug', '-s', '--slug SLUG', 'Use this slug in filename instead of sluggified post title.'
|
43
|
+
c.option 'dir', '-d', '--dir DIR', 'Create post at _posts/DIR/.'
|
38
44
|
CommandHelpers.add_common_options c
|
39
45
|
|
40
46
|
c.action do |args, options|
|
41
|
-
|
42
|
-
|
47
|
+
if args.empty?
|
48
|
+
c.logger.error "Please choose a title."
|
49
|
+
puts c
|
50
|
+
else
|
51
|
+
options['title'] = args.join(" ")
|
52
|
+
Post.new(Octopress.site(options), options).write
|
53
|
+
end
|
43
54
|
end
|
44
55
|
end
|
45
56
|
|
@@ -47,12 +58,17 @@ module Octopress
|
|
47
58
|
c.syntax 'draft <TITLE> [options]'
|
48
59
|
c.description 'Add a new draft post to your Jekyll site.'
|
49
60
|
CommandHelpers.add_page_options c
|
50
|
-
c.option 'slug', '--slug SLUG', 'Use this slug in filename instead of sluggified post title.'
|
61
|
+
c.option 'slug', '-s', '--slug SLUG', 'Use this slug in filename instead of sluggified post title.'
|
51
62
|
CommandHelpers.add_common_options c
|
52
63
|
|
53
64
|
c.action do |args, options|
|
54
|
-
|
55
|
-
|
65
|
+
if args.empty?
|
66
|
+
c.logger.error "Plese choose a title"
|
67
|
+
puts c
|
68
|
+
else
|
69
|
+
options['title'] = args.join(" ")
|
70
|
+
Draft.new(Octopress.site(options), options).write
|
71
|
+
end
|
56
72
|
end
|
57
73
|
end
|
58
74
|
end
|
data/lib/octopress/page.rb
CHANGED
@@ -128,7 +128,7 @@ module Octopress
|
|
128
128
|
file = @options['template'] || default_template
|
129
129
|
|
130
130
|
if file
|
131
|
-
file.sub(/^_templates\//, '')
|
131
|
+
file.sub!(/^_templates\//, '')
|
132
132
|
file = File.join(site.source, '_templates', file) if file
|
133
133
|
if File.exist? file
|
134
134
|
parse_template File.open(file).read
|
data/lib/octopress/version.rb
CHANGED