octopress 3.0.0.rc.12 → 3.0.0.rc.13

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: af8aa291d4f97bb0fe20c1fc5965758ee4701999
4
- data.tar.gz: 4f995072d9b4192bc48a12449f21ff35eaacc8a3
3
+ metadata.gz: fead3f71ad05e8d4ae9bb9037cd98bf46f2dcc6c
4
+ data.tar.gz: 9d4cbd900dcd2b381282d46acbb4cc103c133c24
5
5
  SHA512:
6
- metadata.gz: 58c2b53290232258b67eb395d03297b8ebe9bb01b21c5be8e1c4acd87e33bc95aef431e8d1f65a3612a2d14b41b9270502a0447d7146f30fcd6d3d7e586f698d
7
- data.tar.gz: 5edb343188cb88856c57fc0cb8f20ca4d7037611ff4e1edaf715f6840d5be92732fd2c292a73fa339e59b6063e93326ad43cd7e06c6443c833e08a1482b973de
6
+ metadata.gz: 40a3dd0146e0a4d5ab3d3d911f595a774fae90de19522e5b602065d622dfbcc4f31eaac3888ff28e63b9c02a3aa0628d6b0d13dfb913f7c1e6da2d89c77cfb7a
7
+ data.tar.gz: 79683e347d84488151bfdde5848f4383ffb40b206adafbea9470ab216810622f32f3997b2d4d9d1ecbf06b2737d896c35863deaa44325c11fc16d22823f1230e
data/.gitignore CHANGED
@@ -18,3 +18,4 @@ tmp
18
18
  .sass-cache
19
19
  .code-highlighter-cache
20
20
  test-site
21
+ .DS_Store
@@ -1,13 +1,20 @@
1
1
  # Octopress Changelog
2
2
 
3
3
  ## Current released version
4
- ### 3.0.0 RC11 - 2014-05-23
5
4
 
6
- - Change: Default page template no longer includes a date.
7
- - Improved date management when publishing a draft.
5
+ ### 3.0.0 RC13 - 2014-07-24
6
+
7
+ - Templates are no longer required unless passed as an option.
8
+ - Drafts template default doesn't have a date anymore.
9
+ - Now using octopress filters for titlecase
8
10
 
9
11
  ## Past versions
10
12
 
13
+ ### 3.0.0 RC12 - 2014-05-23
14
+
15
+ - Change: Default page template no longer includes a date.
16
+ - Improved date management when publishing a draft.
17
+
11
18
  ### 3.0.0 RC11 - 2014-05-07
12
19
 
13
20
  - Replaced Hash extensions with Jekyll utility methods.
@@ -7,11 +7,6 @@ require 'octopress'
7
7
 
8
8
  Octopress.require_blessed_gems
9
9
 
10
- if defined? Octopress::Ink
11
- require 'octopress/docs'
12
- Octopress::Ink.register_plugin(Octopress::CLIDocs)
13
- end
14
-
15
10
  if ENV['BUNDLE_BIN_PATH'] || ENV['BUNDLE_GEMFILE']
16
11
  begin
17
12
  require 'bundler'
@@ -1,7 +1,7 @@
1
1
  require 'mercenary'
2
+ require 'octopress-filters'
2
3
 
3
4
  module Octopress
4
- require 'octopress/utils'
5
5
  require 'octopress/configuration'
6
6
  require 'octopress/command'
7
7
  require 'octopress/version'
@@ -95,10 +95,15 @@ module Octopress
95
95
  read
96
96
  end
97
97
  end
98
+
99
+ def default_template
100
+ 'draft'
101
+ end
98
102
 
99
103
  # Draft template defaults
100
104
  #
101
105
  def default_content
106
+
102
107
  if @options['date']
103
108
  front_matter %w{layout title date}
104
109
  else
@@ -63,7 +63,9 @@ module Octopress
63
63
  def set_default_options
64
64
  @options['type'] ||= 'page'
65
65
  @options['layout'] = @config['page_layout']
66
- @options['date'] = convert_date @options['date']
66
+ if @options['date']
67
+ @options['date'] = convert_date @options['date']
68
+ end
67
69
  @options['extension'] ||= @config['page_ext']
68
70
  @options['template'] ||= @config['page_template']
69
71
  end
@@ -95,8 +97,10 @@ module Octopress
95
97
  file = File.join(source, '_templates', file) if file
96
98
  if File.exist? file
97
99
  parse_template File.open(file).read
98
- else
100
+ elsif @options['template']
99
101
  abort "No #{@options['type']} template found at #{file}"
102
+ else
103
+ parse_template default_content
100
104
  end
101
105
  else
102
106
  parse_template default_content
@@ -110,19 +114,26 @@ module Octopress
110
114
  # Render Liquid vars in YAML front-matter.
111
115
  def parse_template(input)
112
116
 
113
- Octopress::Utils.titlecase!(@options['title']) if @config['titlecase']
117
+ if @config['titlecase']
118
+ @options['title'] = Octopress::Filters.titlecase(@options['title'])
119
+ end
114
120
  # If possible only parse the YAML front matter.
115
121
  # If YAML front-matter dashes aren't present parse the whole
116
122
  # template and add dashes.
117
123
  #
118
124
 
119
125
  parsed = if input =~ /\A-{3}\s+(.+?)\s+-{3}(.+)?/m
120
- template = Liquid::Template.parse($1)
121
- "---\n#{template.render(@options).strip}\n---\n#{$2}"
126
+ input = $1
127
+ content = $2
128
+ if @options['date'] && !(input =~ /date:/)
129
+ input += "\ndate: #{@options['date']}"
130
+ end
122
131
  else
123
- template = Liquid::Template.parse(input)
124
- "---\n#{template.render(@options).strip}\n---\n"
132
+ content = ''
125
133
  end
134
+
135
+ template = Liquid::Template.parse(input)
136
+ "---\n#{template.render(@options).strip}\n---\n#{content}"
126
137
  end
127
138
 
128
139
  def date_slug
@@ -1,3 +1,3 @@
1
1
  module Octopress
2
- VERSION = "3.0.0.rc.12"
2
+ VERSION = "3.0.0.rc.13"
3
3
  end
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_runtime_dependency "mercenary", "~> 0.3.2"
22
22
  spec.add_runtime_dependency "jekyll", "~> 2.0"
23
+ spec.add_runtime_dependency "octopress-filters", "~> 1.1"
23
24
 
24
25
  spec.add_development_dependency "octopress-ink"
25
26
  spec.add_development_dependency "bundler", "~> 1.3"
@@ -0,0 +1,4 @@
1
+ ---
2
+ layout: {{ layout }}
3
+ title: {{ title }}
4
+ ---
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'octopress', path: '../'
4
+ gem 'pry-debugger'
@@ -0,0 +1,4 @@
1
+ ---
2
+ layout: {{ layout }}
3
+ title: {{ title }}
4
+ ---
@@ -157,6 +157,6 @@ end
157
157
  # Build the site
158
158
  #
159
159
  system "cd test-site; octopress build; cd -"
160
- test_dirs('Compare directories', 'test-site', 'expected')
160
+ test_dirs('Compare directories', 'expected', 'test-site')
161
161
 
162
162
  print_results
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.12
4
+ version: 3.0.0.rc.13
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-05-23 00:00:00.000000000 Z
12
+ date: 2014-07-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mercenary
@@ -39,6 +39,20 @@ dependencies:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
41
  version: '2.0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: octopress-filters
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '1.1'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '1.1'
42
56
  - !ruby/object:Gem::Dependency
43
57
  name: octopress-ink
44
58
  requirement: !ruby/object:Gem::Requirement
@@ -134,8 +148,10 @@ files:
134
148
  - lib/octopress/version.rb
135
149
  - octopress.gemspec
136
150
  - scaffold/_octopress.yml
151
+ - scaffold/_templates/draft
137
152
  - scaffold/_templates/page
138
153
  - scaffold/_templates/post
154
+ - test/Gemfile
139
155
  - test/expected/_config.yml
140
156
  - test/expected/_drafts/stupid-idea.markdown
141
157
  - test/expected/_layouts/page.html
@@ -160,6 +176,7 @@ files:
160
176
  - test/expected/_site/index.html
161
177
  - test/expected/_site/okay-page/index.html
162
178
  - test/expected/_templates/date_page
179
+ - test/expected/_templates/draft
163
180
  - test/expected/_templates/other_page
164
181
  - test/expected/_templates/page
165
182
  - test/expected/_templates/post
@@ -197,6 +214,7 @@ specification_version: 4
197
214
  summary: Octopress is an obsessively designed framework for Jekyll blogging. It’s
198
215
  easy to configure and easy to deploy. Sweet huh?
199
216
  test_files:
217
+ - test/Gemfile
200
218
  - test/expected/_config.yml
201
219
  - test/expected/_drafts/stupid-idea.markdown
202
220
  - test/expected/_layouts/page.html
@@ -221,6 +239,7 @@ test_files:
221
239
  - test/expected/_site/index.html
222
240
  - test/expected/_site/okay-page/index.html
223
241
  - test/expected/_templates/date_page
242
+ - test/expected/_templates/draft
224
243
  - test/expected/_templates/other_page
225
244
  - test/expected/_templates/page
226
245
  - test/expected/_templates/post