octopress 3.0.0.rc.16 → 3.0.0.rc.17

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
  SHA1:
3
- metadata.gz: c467f204f6a64e2cb3cc180b6d3b0047e6ef51db
4
- data.tar.gz: 26566e933b1e7b3749c3f65469fbfe8b9dfc378b
3
+ metadata.gz: f479839dc1695278cc9852771af311ab70f6b1e2
4
+ data.tar.gz: 061cf5d2b7860efdd16f9eb5370864afe67d9356
5
5
  SHA512:
6
- metadata.gz: 2172acbd11141bb8253035f8ad76baa6cdc57e37278c7c5dbc3c93a8199bc8b6333aabe0c49f03b4c7dabb03d1dd87d002625a0f0fb227a5e2d601d9bfc24347
7
- data.tar.gz: ac045544e83a6a7137363f80f48d1a2c7ac6f98bb60704382768b3fcd557e938f64d7dca11d2a778f06874311ca4b0e235fe2632a05e615087b3203eb107f93c
6
+ metadata.gz: 6164d99a472f778e2fdcdcca93b8fb519bdc70cc340b9c65e09a73d36b4b19bcc825d110660da6be6e50695a8514381c9a8431ded5dad55199159120a3292194
7
+ data.tar.gz: 5f0460bec58ca35bd67aa0f9e259a5f22ea70613acc7645bca58336db66b9f38412283140077b4c04953735ace781892c01ed2e42c0e7325b8bd35eb5ab5d944
data/CHANGELOG.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Octopress Changelog
2
2
 
3
- ## Current released version
3
+ ### 3.0.0 RC17 - 2014-12-08
4
+
5
+ - Added a configuration tip when adding a new collection page.
4
6
 
5
7
  ### 3.0.0 RC16 - 2014-11-24
6
8
 
@@ -12,8 +14,6 @@
12
14
  - Simplified configuration management.
13
15
  - Now requiring titlecase gem directly.
14
16
 
15
- ## Past versions
16
-
17
17
  ### 3.0.0 RC13 - 2014-07-24
18
18
 
19
19
  - Templates are no longer required unless passed as an option.
data/assets/docs/index.md CHANGED
@@ -64,7 +64,7 @@ title: "My Title"
64
64
  date: YYYY-MM-DDTHH:MM:SS-00:00
65
65
  ```
66
66
 
67
- "OK, great. What else can I do?" Great question! Check out these other options:
67
+ #### Command options
68
68
 
69
69
  | Option | Description |
70
70
  |:---------------------|:----------------------------------------|
@@ -76,12 +76,26 @@ date: YYYY-MM-DDTHH:MM:SS-00:00
76
76
 
77
77
  ### New Page
78
78
 
79
+ Creating a new page is easy, you can use the default file name extension (.html), pass a specific extension, or end with a `/` to create
80
+ an index.html document.
81
+
79
82
  ```
80
83
  $ octopress new page some-page # ./some-page.html
84
+ $ octopress new page about.md # ./about.md
81
85
  $ octopress new page docs/ # ./docs/index.html
82
- $ octopress new page about.html # ./about.html
83
86
  ```
84
87
 
88
+ If you are working with collections, you might add a page like this:
89
+
90
+ ```
91
+ $ octopress new page _legal/terms # ./_legal/terms.html
92
+ ```
93
+
94
+ After the page is created, Octopress will tell you how to configure this new collection.
95
+
96
+
97
+ #### Command options
98
+
85
99
  | Option | Description |
86
100
  |:---------------------|:----------------------------------------|
87
101
  | `--template PATH` | Use a template from <path> |
@@ -19,25 +19,49 @@ module Octopress
19
19
 
20
20
  def write
21
21
  if File.exist?(path) && !@options['force']
22
- raise "File #{relative_path} already exists. Use --force to overwrite."
22
+ raise "File #{relative_path(path)} already exists. Use --force to overwrite."
23
23
  end
24
24
 
25
- FileUtils.mkdir_p(File.dirname(path))
25
+ dir = File.dirname(path)
26
+
27
+ FileUtils.mkdir_p(dir)
26
28
  File.open(path, 'w') { |f| f.write(@content) }
27
29
  if STDOUT.tty?
28
- puts "New #{@options['type']}: #{relative_path}"
30
+ puts "New #{@options['type']}: #{relative_path(path)}"
31
+
32
+ # If path begins with an underscore the page is probably being added to a collection
33
+ #
34
+ print_collection_tip($1) if dir =~ /#{source}\/_([^\/]+)/
29
35
  else
30
36
  puts path
31
37
  end
32
38
  end
33
39
 
34
- def relative_path
40
+ # Print instructions for setting up a new collection
41
+ #
42
+ def print_collection_tip(collection)
43
+ # If Jekyll is not already configurated for this collection, print instructions
44
+ #
45
+ if !jekyll_config['collections'] || !jekyll_config['collections'][collection]
46
+ msg = "\nTIP: To create a new '#{collection}' collection, add this to your Jekyll configuration\n"
47
+ msg += "----------------\n"
48
+ msg += "collections:\n #{collection}:\n output: true"
49
+ msg += "\n----------------"
50
+ puts msg
51
+ end
52
+ end
53
+
54
+ def relative_path(path)
35
55
  local = Dir.pwd + '/'
36
56
  path.sub(local, '')
37
57
  end
38
58
 
59
+ def jekyll_config
60
+ Configuration.jekyll_config(@options)
61
+ end
62
+
39
63
  def source
40
- Configuration.jekyll_config(@options)['source']
64
+ jekyll_config['source']
41
65
  end
42
66
 
43
67
  def path
@@ -1,3 +1,3 @@
1
1
  module Octopress
2
- VERSION = "3.0.0.rc.16"
2
+ VERSION = "3.0.0.rc.17"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.rc.16
4
+ version: 3.0.0.rc.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-24 00:00:00.000000000 Z
12
+ date: 2014-12-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mercenary