octopress 3.0.0.rc.35 → 3.0.0.rc.36

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: 26f37431f58cb3e1768fdb2ba4a2b6fea442fb4c
4
- data.tar.gz: 3ae5d6d3f6d07f80fb8ccc494cded105e390315f
3
+ metadata.gz: b08d794360068ba72052efefd497779499f23a45
4
+ data.tar.gz: e6797ddb7a7a2003665b2fd75c419d46ba5889f7
5
5
  SHA512:
6
- metadata.gz: f8703ccaf1fae3dfaaf71d40dd1f9b4990478be16b8b61410875a0b1ef49f0a02462bc7d7d8a72f4d444c59489a3b061a9f08cb82df06ca2db3a0f69e9350d53
7
- data.tar.gz: 9940d5b97ab7660273120f8b1ccdfe760446b3cbc8271448d680a00f5cce3986701ad61fea325cb8ebed1e5b7db248d1e4794e6c43e96e4aae56687142570e11
6
+ metadata.gz: d02e7f4f06301d06870ced806bd42b367abd157abd2c04dbcf7048c43962a064f9377daf47b3c1995d2cbca45e06f483fde98de93541310141ca63e9aeab754f
7
+ data.tar.gz: 572c1d688ff5d73962ddfb239b437e13c72b476abf5651755f637b887f04eb3422b36b9dfb540738356be2c7e9a4cd61c5a0f098fbbd00a1d8d6b3a642f1d802
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ### 3.0.0 RC36 (2015-04-29)
4
+
5
+ - Fix: Layout is not automatically added to post/page templates
6
+ - Minor: Improved output for publishing drafts.
7
+
3
8
  ### 3.0.0 RC35 (2015-03-21)
4
9
 
5
10
  - Raised minimum Jekyll version to 2.5.
@@ -4,7 +4,7 @@ module Octopress
4
4
 
5
5
  def add_page_options(c)
6
6
  c.option 'date', '-d', '--date DATE', "Use 'now' or a String that is parseable by Time#parse."
7
- c.option 'template', '-tm', '--template PATH', "New #{c.name.to_s} from a template."
7
+ c.option 'template', '-T','--template PATH', "New #{c.name.to_s} from a template."
8
8
  c.option 'force', '-f', '--force', 'Overwrite file if it already exists'
9
9
  end
10
10
 
@@ -26,7 +26,7 @@ module Octopress
26
26
 
27
27
  c.action do |args, options|
28
28
  if args.empty?
29
- c.logger.error "Plese choose a path"
29
+ c.logger.error "Plese pass a path for your new page."
30
30
  puts c
31
31
  else
32
32
  options['path'] = args.first
@@ -45,7 +45,7 @@ module Octopress
45
45
 
46
46
  c.action do |args, options|
47
47
  if args.empty?
48
- c.logger.error "Please choose a title."
48
+ c.logger.error "Please pass a title for your new post."
49
49
  puts c
50
50
  else
51
51
  options['title'] = args.join(" ")
@@ -63,7 +63,7 @@ module Octopress
63
63
 
64
64
  c.action do |args, options|
65
65
  if args.empty?
66
- c.logger.error "Plese choose a title"
66
+ c.logger.error "Plese pass a title for your new draft."
67
67
  puts c
68
68
  else
69
69
  options['title'] = args.join(" ")
@@ -3,6 +3,7 @@ module Octopress
3
3
 
4
4
  def set_default_options
5
5
  @options['type'] ||= 'draft'
6
+ @options['write_message'] ||= 'New draft:'
6
7
 
7
8
  if @options['title'].nil? && @options[:type] == 'post'
8
9
  raise "Draft not created: Please choose a title.\n".red + " For example: " + "octopress new draft 'The merits of napping'".yellow
@@ -38,7 +39,8 @@ module Octopress
38
39
  'slug' => title_slug,
39
40
  'content' => read_post_content,
40
41
  'dir' => @options['dir'],
41
- 'type' => 'post from draft'
42
+ 'type' => "post from draft",
43
+ 'write_message' => "Published: #{relative_path(path)} →"
42
44
  }
43
45
 
44
46
  # Create a new post file
@@ -17,7 +17,7 @@ module Octopress
17
17
  @options = options
18
18
  set_default_options
19
19
 
20
- @front_matter = %w{layout title date}
20
+ @front_matter = %w{title date}
21
21
 
22
22
  # Ensure title
23
23
  #
@@ -25,7 +25,7 @@ module Octopress
25
25
 
26
26
  # Ensure a quoted title to avoid YAML parsing issues.
27
27
  #
28
- @options['title'] = "\"#{@options['title']}\""
28
+ @options['title'] = "#{@options['title']}"
29
29
 
30
30
  @content = options['content'] || content
31
31
  end
@@ -36,7 +36,7 @@ module Octopress
36
36
 
37
37
  def write
38
38
  if File.exist?(path) && !@options['force']
39
- raise "File #{relative_path(path)} already exists. Use --force to overwrite."
39
+ abort "File #{relative_path(path)} already exists. Use --force to overwrite."
40
40
  end
41
41
 
42
42
  dir = File.dirname(path)
@@ -44,7 +44,7 @@ module Octopress
44
44
  FileUtils.mkdir_p(dir)
45
45
  File.open(path, 'w') { |f| f.write(@content) }
46
46
  if STDOUT.tty?
47
- puts "New #{@options['type']}: #{relative_path(path)}"
47
+ puts "#{@options['write_message']} #{relative_path(path)}"
48
48
 
49
49
  # If path begins with an underscore the page is probably being added to a collection
50
50
  #
@@ -97,6 +97,7 @@ module Octopress
97
97
 
98
98
  def set_default_options
99
99
  @options['type'] ||= 'page'
100
+ @options['write_message'] ||= 'New page:'
100
101
  @options['layout'] = @config['page_layout']
101
102
  if @options['date']
102
103
  @options['date'] = convert_date @options['date']
@@ -3,6 +3,7 @@ module Octopress
3
3
 
4
4
  def set_default_options
5
5
  @options['type'] ||= 'post'
6
+ @options['write_message'] ||= 'New post:'
6
7
 
7
8
  if @options['title'].nil? && @options[:type] == 'post'
8
9
  raise "Post not created: Please choose a title.\n".red + " For example: " + "octopress new post \"Friendship with a tomato?\"".yellow
@@ -36,8 +37,10 @@ module Octopress
36
37
  'slug' => title_slug,
37
38
  'content' => read_post_content,
38
39
  'dir' => @options['dir'],
39
- 'type' => 'draft from post'
40
+ 'type' => "draft from post",
41
+ 'write_message' => "Unpublished: #{relative_path(path)} →"
40
42
  }
43
+
41
44
  Draft.new(site, post_options).write
42
45
 
43
46
  # Remove the old post file
@@ -1,3 +1,3 @@
1
1
  module Octopress
2
- VERSION = "3.0.0.rc.35"
2
+ VERSION = "3.0.0.rc.36"
3
3
  end
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  layout: {{ layout }}
3
- title: {{ title }}
3
+ title: "{{ title }}"
4
4
  ---
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  layout: {{ layout }}
3
- title: {{ title }}
3
+ title: "{{ title }}"
4
4
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  layout: {{ layout }}
3
- title: {{ title }}
3
+ title: "{{ title }}"
4
4
  date: {{ date }}
5
5
  ---
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.35
4
+ version: 3.0.0.rc.36
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: 2015-03-21 00:00:00.000000000 Z
12
+ date: 2015-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mercenary
@@ -249,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
249
249
  version: 1.3.1
250
250
  requirements: []
251
251
  rubyforge_project:
252
- rubygems_version: 2.2.2
252
+ rubygems_version: 2.4.6
253
253
  signing_key:
254
254
  specification_version: 4
255
255
  summary: Octopress is an obsessively designed framework for Jekyll blogging. It’s