spinto-jekyll 0.11.2.3 → 0.11.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,11 +5,14 @@
5
5
  * Allow setting of RedCloth options (#284)
6
6
  * Add post_url Liquid tag for internal post linking (#369)
7
7
  * Allow multiple plugin dirs to be specified (#438)
8
+ * Inline TOC token support for RDiscount (#333)
9
+ * Add the option to specify the paginated url format (#342)
8
10
  * Bug Fixes
9
11
  * Allow some special characters in highlight names
10
12
  * URL escape category names in URL generation (#360)
11
13
  * Fix error with limit_posts (#442)
12
14
  * Properly select dotfile during directory scan (#363, #431, #377)
15
+ * Allow setting of Kramdown smart_quotes (#482)
13
16
 
14
17
  == 0.11.2 / 2011-12-27
15
18
  * Bug Fixes
data/bin/jekyll CHANGED
@@ -106,7 +106,7 @@ opts = OptionParser.new do |opts|
106
106
  opts.on("--permalink [TYPE]", "Use 'date' (default) for YYYY/MM/DD") do |style|
107
107
  options['permalink'] = style unless style.nil?
108
108
  end
109
-
109
+
110
110
  opts.on("--paginate [POSTS_PER_PAGE]", "Paginate a blog's posts") do |per_page|
111
111
  begin
112
112
  options['paginate'] = per_page.to_i
@@ -117,6 +117,16 @@ opts = OptionParser.new do |opts|
117
117
  end
118
118
  end
119
119
 
120
+ opts.on("--paginate_path [PAGINATED_URL_FORMAT]", "Leave blank for /page<num>") do |paginate_path|
121
+ begin
122
+ options['paginate_path'] = paginate_path
123
+ raise ArgumentError if options['paginate_path'].nil?
124
+ rescue
125
+ puts 'You must specify a pagination url format'
126
+ exit 0
127
+ end
128
+ end
129
+
120
130
  opts.on("--limit_posts [MAX_POSTS]", "Limit the number of posts to publish") do |limit_posts|
121
131
  begin
122
132
  options['limit_posts'] = limit_posts.to_i
@@ -156,12 +166,12 @@ if ARGV.size > 0
156
166
  else
157
167
  migrator = migrator.downcase
158
168
  end
159
-
169
+
160
170
  cmd_options = []
161
171
  ['file', 'dbname', 'user', 'pass', 'host', 'site'].each do |p|
162
172
  cmd_options << "\"#{options[p]}\"" unless options[p].nil?
163
173
  end
164
-
174
+
165
175
  # It's import time
166
176
  puts "Importing..."
167
177
 
@@ -19,9 +19,36 @@ Feature: Site pagination
19
19
  And the "_site/page<exist>/index.html" file should exist
20
20
  And I should see "<posts>" in "_site/page<exist>/index.html"
21
21
  And the "_site/page<not_exist>/index.html" file should not exist
22
-
22
+
23
23
  Examples:
24
24
  | num | exist | posts | not_exist |
25
25
  | 1 | 4 | 1 | 5 |
26
26
  | 2 | 2 | 2 | 3 |
27
27
  | 3 | 2 | 1 | 3 |
28
+
29
+ Scenario Outline: Setting a custom pagination path
30
+ Given I have a configuration file with:
31
+ | key | value |
32
+ | paginate | 1 |
33
+ | paginate_path | /blog/page-:num |
34
+ | permalink | /blog/:year/:month/:day/:title |
35
+ And I have a _layouts directory
36
+ And I have an "index.html" page that contains "{{ paginator.posts.size }}"
37
+ And I have a _posts directory
38
+ And I have the following post:
39
+ | title | date | layout | content |
40
+ | Wargames | 3/27/2009 | default | The only winning move is not to play. |
41
+ | Wargames2 | 4/27/2009 | default | The only winning move is not to play2. |
42
+ | Wargames3 | 5/27/2009 | default | The only winning move is not to play3. |
43
+ | Wargames4 | 6/27/2009 | default | The only winning move is not to play4. |
44
+ When I run jekyll
45
+ Then the _site/blog/page-<exist> directory should exist
46
+ And the "_site/blog/page-<exist>/index.html" file should exist
47
+ And I should see "<posts>" in "_site/blog/page-<exist>/index.html"
48
+ And the "_site/blog/page-<not_exist>/index.html" file should not exist
49
+
50
+ Examples:
51
+ | exist | posts | not_exist |
52
+ | 2 | 1 | 5 |
53
+ | 3 | 1 | 6 |
54
+ | 4 | 1 | 7 |
@@ -121,7 +121,7 @@ When /^I change "(.*)" to contain "(.*)"$/ do |file, text|
121
121
  end
122
122
 
123
123
  Then /^the (.*) directory should exist$/ do |dir|
124
- assert File.directory?(dir)
124
+ assert File.directory?(dir), "The directory \"#{dir}\" does not exist"
125
125
  end
126
126
 
127
127
  Then /^I should see "(.*)" in "(.*)"$/ do |text, file|
@@ -51,10 +51,10 @@ module Jekyll
51
51
  # Default options. Overriden by values in _config.yml or command-line opts.
52
52
  # (Strings rather symbols used for compatability with YAML).
53
53
  DEFAULTS = {
54
- 'safe' => false,
55
- 'auto' => false,
56
- 'server' => false,
57
- 'server_port' => 4000,
54
+ 'safe' => false,
55
+ 'auto' => false,
56
+ 'server' => false,
57
+ 'server_port' => 4000,
58
58
 
59
59
  'source' => Dir.pwd,
60
60
  'destination' => File.join(Dir.pwd, '_site'),
@@ -66,6 +66,7 @@ module Jekyll
66
66
  'markdown' => 'maruku',
67
67
  'permalink' => 'date',
68
68
  'include' => ['.htaccess'],
69
+ 'paginate_path' => 'page:num',
69
70
 
70
71
  'markdown_ext' => 'markdown,mkd,mkdn,md',
71
72
  'textile_ext' => 'textile',
@@ -88,6 +89,7 @@ module Jekyll
88
89
  'footnote_nr' => 1,
89
90
  'entity_output' => 'as_char',
90
91
  'toc_levels' => '1..6',
92
+ 'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo',
91
93
  'use_coderay' => false,
92
94
 
93
95
  'coderay' => {
@@ -97,6 +97,7 @@ module Jekyll
97
97
  :footnote_nr => @config['kramdown']['footnote_nr'],
98
98
  :entity_output => @config['kramdown']['entity_output'],
99
99
  :toc_levels => @config['kramdown']['toc_levels'],
100
+ :smart_quotes => @config['kramdown']['smart_quotes'],
100
101
 
101
102
  :coderay_wrap => @config['kramdown']['coderay']['coderay_wrap'],
102
103
  :coderay_line_numbers => @config['kramdown']['coderay']['coderay_line_numbers'],
@@ -111,11 +112,17 @@ module Jekyll
111
112
  :auto_ids => @config['kramdown']['auto_ids'],
112
113
  :footnote_nr => @config['kramdown']['footnote_nr'],
113
114
  :entity_output => @config['kramdown']['entity_output'],
114
- :toc_levels => @config['kramdown']['toc_levels']
115
+ :toc_levels => @config['kramdown']['toc_levels'],
116
+ :smart_quotes => @config['kramdown']['smart_quotes']
115
117
  }).to_html
116
118
  end
117
119
  when 'rdiscount'
118
- RDiscount.new(content, *@rdiscount_extensions).to_html
120
+ rd = RDiscount.new(content, *@rdiscount_extensions)
121
+ html = rd.to_html
122
+ if rd.generate_toc and html.include?(@config['rdiscount']['toc_token'])
123
+ html.gsub!(@config['rdiscount']['toc_token'], rd.toc_content)
124
+ end
125
+ html
119
126
  when 'maruku'
120
127
  Maruku.new(content).to_html
121
128
  end
@@ -37,13 +37,19 @@ module Jekyll
37
37
  if num_page > 1
38
38
  newpage = Page.new(site, site.source, page.dir, page.name)
39
39
  newpage.pager = pager
40
- newpage.dir = File.join(page.dir, "page#{num_page}")
40
+ newpage.dir = File.join(page.dir, paginate_path(site, num_page))
41
41
  site.pages << newpage
42
42
  else
43
43
  page.pager = pager
44
44
  end
45
45
  end
46
46
  end
47
+
48
+ private
49
+ def paginate_path(site, num_page)
50
+ format = site.config['paginate_path']
51
+ format.sub(':num', num_page.to_s)
52
+ end
47
53
  end
48
54
 
49
55
  class Pager
@@ -200,18 +200,19 @@ module Jekyll
200
200
  #
201
201
  # Returns nothing.
202
202
  def render
203
+ payload = site_payload
203
204
  self.posts.each do |post|
204
- post.render(self.layouts, site_payload)
205
+ post.render(self.layouts, payload)
205
206
  end
206
207
 
207
208
  if self.preview
208
209
  self.unpublished_posts.sort.each do |post|
209
- post.render(self.layouts, site_payload)
210
+ post.render(self.layouts, payload)
210
211
  end
211
212
  end
212
213
 
213
214
  self.pages.each do |page|
214
- page.render(self.layouts, site_payload)
215
+ page.render(self.layouts, payload)
215
216
  end
216
217
 
217
218
  self.categories.values.map { |ps| ps.sort! { |a, b| b <=> a } }
@@ -1,3 +1,3 @@
1
1
  module SpintoJekyll
2
- VERSION = '0.11.2.3'
2
+ VERSION = '0.11.2.5'
3
3
  end
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
4
4
  s.rubygems_version = '1.3.5'
5
5
 
6
6
  s.name = 'spinto-jekyll'
7
- s.version = '0.11.2.3'
8
- s.date = '2012-03-27'
7
+ s.version = '0.11.2.5'
8
+ s.date = '2012-05-01'
9
9
  s.rubyforge_project = 'spinto-jekyll'
10
10
 
11
11
  s.summary = "A simple, blog aware, static site generator."
@@ -22,11 +22,11 @@ Gem::Specification.new do |s|
22
22
  s.rdoc_options = ["--charset=UTF-8"]
23
23
  s.extra_rdoc_files = %w[README.textile LICENSE]
24
24
 
25
- s.add_runtime_dependency('spinto-liquid', "~> 2.3")
25
+ s.add_runtime_dependency('spinto-liquid', "~> 2.3.0.3")
26
26
  s.add_runtime_dependency('classifier', "~> 1.3")
27
27
  s.add_runtime_dependency('directory_watcher', "~> 1.1")
28
28
  s.add_runtime_dependency('maruku', "~> 0.5")
29
- s.add_runtime_dependency('kramdown', "~> 0.13")
29
+ s.add_runtime_dependency('kramdown', "~> 0.13.4")
30
30
  s.add_runtime_dependency('albino', "~> 1.3")
31
31
 
32
32
  s.add_development_dependency('rake', "~> 0.9")
@@ -3,21 +3,31 @@ require 'helper'
3
3
  class TestKramdown < Test::Unit::TestCase
4
4
  context "kramdown" do
5
5
  setup do
6
- config = {
6
+ @config = {
7
7
  'markdown' => 'kramdown',
8
8
  'kramdown' => {
9
9
  'auto_ids' => false,
10
10
  'footnote_nr' => 1,
11
11
  'entity_output' => 'as_char',
12
- 'toc_levels' => '1..6'
12
+ 'toc_levels' => '1..6',
13
+ 'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo'
13
14
  }
14
15
  }
15
- @markdown = MarkdownConverter.new config
16
16
  end
17
17
 
18
18
  # http://kramdown.rubyforge.org/converter/html.html#options
19
19
  should "pass kramdown options" do
20
- assert_equal "<h1>Some Header</h1>", @markdown.convert('# Some Header #').strip
20
+ markdown = MarkdownConverter.new(@config)
21
+ assert_equal "<h1>Some Header</h1>", markdown.convert('# Some Header #').strip
22
+ end
23
+
24
+ should "convert quotes to smart quotes" do
25
+ markdown = MarkdownConverter.new(@config)
26
+ assert_equal "<p>&ldquo;Pit&rsquo;hy&rdquo;</p>", markdown.convert(%{"Pit'hy"}).strip
27
+
28
+ override = { 'kramdown' => { 'smart_quotes' => 'lsaquo,rsaquo,laquo,raquo' } }
29
+ markdown = MarkdownConverter.new(@config.deep_merge(override))
30
+ assert_equal "<p>&laquo;Pit&rsaquo;hy&raquo;</p>", markdown.convert(%{"Pit'hy"}).strip
21
31
  end
22
32
  end
23
33
  end
@@ -5,8 +5,8 @@ class TestRdiscount < Test::Unit::TestCase
5
5
  context "rdiscount" do
6
6
  setup do
7
7
  config = {
8
- 'rdiscount' => { 'extensions' => ['smart'] },
9
- 'markdown' => 'rdiscount'
8
+ 'markdown' => 'rdiscount',
9
+ 'rdiscount' => { 'extensions' => ['smart', 'generate_toc'], 'toc_token' => '{:toc}' }
10
10
  }
11
11
  @markdown = MarkdownConverter.new config
12
12
  end
@@ -14,5 +14,9 @@ class TestRdiscount < Test::Unit::TestCase
14
14
  should "pass rdiscount extensions" do
15
15
  assert_equal "<p>&ldquo;smart&rdquo;</p>", @markdown.convert('"smart"').strip
16
16
  end
17
+
18
+ should "render toc" do
19
+ assert_equal "<h1 id=\"Header+1\">Header 1</h1>\n\n<h2 id=\"Header+2\">Header 2</h2>\n\n<p>\n <ul>\n <li><a href=\"#Header+1\">Header 1</a>\n <ul>\n <li><a href=\"#Header+2\">Header 2</a> </li>\n </ul>\n </li>\n </ul>\n\n</p>", @markdown.convert("# Header 1\n\n## Header 2\n\n{:toc}").strip
20
+ end
17
21
  end
18
22
  end
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/helper'
1
+ require 'helper'
2
2
 
3
3
  class TestRedcarpet < Test::Unit::TestCase
4
4
  context "redcarpet" do
@@ -6,7 +6,7 @@ class TestTags < Test::Unit::TestCase
6
6
 
7
7
  def create_post(content, override = {}, converter_class = Jekyll::MarkdownConverter)
8
8
  stub(Jekyll).configuration do
9
- Jekyll::DEFAULTS.merge({'pygments' => true}).merge(override)
9
+ Jekyll::DEFAULTS.deep_merge({'pygments' => true}).deep_merge(override)
10
10
  end
11
11
  site = Site.new(Jekyll.configuration)
12
12
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spinto-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2.3
4
+ version: 0.11.2.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,22 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-03-27 00:00:00.000000000 Z
13
+ date: 2012-05-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: spinto-liquid
17
- requirement: &2181013520 !ruby/object:Gem::Requirement
17
+ requirement: &2167463280 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
21
21
  - !ruby/object:Gem::Version
22
- version: '2.3'
22
+ version: 2.3.0.3
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2181013520
25
+ version_requirements: *2167463280
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: classifier
28
- requirement: &2181013040 !ruby/object:Gem::Requirement
28
+ requirement: &2167467200 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '1.3'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *2181013040
36
+ version_requirements: *2167467200
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: directory_watcher
39
- requirement: &2181012580 !ruby/object:Gem::Requirement
39
+ requirement: &2167188340 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '1.1'
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *2181012580
47
+ version_requirements: *2167188340
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: maruku
50
- requirement: &2181012120 !ruby/object:Gem::Requirement
50
+ requirement: &2166730300 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ~>
@@ -55,21 +55,21 @@ dependencies:
55
55
  version: '0.5'
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *2181012120
58
+ version_requirements: *2166730300
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: kramdown
61
- requirement: &2181011660 !ruby/object:Gem::Requirement
61
+ requirement: &2166683980 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ~>
65
65
  - !ruby/object:Gem::Version
66
- version: '0.13'
66
+ version: 0.13.4
67
67
  type: :runtime
68
68
  prerelease: false
69
- version_requirements: *2181011660
69
+ version_requirements: *2166683980
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: albino
72
- requirement: &2181011200 !ruby/object:Gem::Requirement
72
+ requirement: &2166634560 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ~>
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: '1.3'
78
78
  type: :runtime
79
79
  prerelease: false
80
- version_requirements: *2181011200
80
+ version_requirements: *2166634560
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rake
83
- requirement: &2181010740 !ruby/object:Gem::Requirement
83
+ requirement: &2166578160 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ~>
@@ -88,10 +88,10 @@ dependencies:
88
88
  version: '0.9'
89
89
  type: :development
90
90
  prerelease: false
91
- version_requirements: *2181010740
91
+ version_requirements: *2166578160
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: rdoc
94
- requirement: &2181010280 !ruby/object:Gem::Requirement
94
+ requirement: &2166550520 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - ~>
@@ -99,10 +99,10 @@ dependencies:
99
99
  version: '3.11'
100
100
  type: :development
101
101
  prerelease: false
102
- version_requirements: *2181010280
102
+ version_requirements: *2166550520
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: redgreen
105
- requirement: &2181009820 !ruby/object:Gem::Requirement
105
+ requirement: &2166487820 !ruby/object:Gem::Requirement
106
106
  none: false
107
107
  requirements:
108
108
  - - ~>
@@ -110,10 +110,10 @@ dependencies:
110
110
  version: '1.2'
111
111
  type: :development
112
112
  prerelease: false
113
- version_requirements: *2181009820
113
+ version_requirements: *2166487820
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: shoulda
116
- requirement: &2181009360 !ruby/object:Gem::Requirement
116
+ requirement: &2166419060 !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements:
119
119
  - - ~>
@@ -121,10 +121,10 @@ dependencies:
121
121
  version: '2.11'
122
122
  type: :development
123
123
  prerelease: false
124
- version_requirements: *2181009360
124
+ version_requirements: *2166419060
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rr
127
- requirement: &2181008900 !ruby/object:Gem::Requirement
127
+ requirement: &2166363660 !ruby/object:Gem::Requirement
128
128
  none: false
129
129
  requirements:
130
130
  - - ~>
@@ -132,10 +132,10 @@ dependencies:
132
132
  version: '1.0'
133
133
  type: :development
134
134
  prerelease: false
135
- version_requirements: *2181008900
135
+ version_requirements: *2166363660
136
136
  - !ruby/object:Gem::Dependency
137
137
  name: cucumber
138
- requirement: &2181008440 !ruby/object:Gem::Requirement
138
+ requirement: &2166337000 !ruby/object:Gem::Requirement
139
139
  none: false
140
140
  requirements:
141
141
  - - =
@@ -143,10 +143,10 @@ dependencies:
143
143
  version: '1.1'
144
144
  type: :development
145
145
  prerelease: false
146
- version_requirements: *2181008440
146
+ version_requirements: *2166337000
147
147
  - !ruby/object:Gem::Dependency
148
148
  name: RedCloth
149
- requirement: &2181007980 !ruby/object:Gem::Requirement
149
+ requirement: &2166290820 !ruby/object:Gem::Requirement
150
150
  none: false
151
151
  requirements:
152
152
  - - ~>
@@ -154,10 +154,10 @@ dependencies:
154
154
  version: '4.2'
155
155
  type: :development
156
156
  prerelease: false
157
- version_requirements: *2181007980
157
+ version_requirements: *2166290820
158
158
  - !ruby/object:Gem::Dependency
159
159
  name: rdiscount
160
- requirement: &2181007520 !ruby/object:Gem::Requirement
160
+ requirement: &2166218000 !ruby/object:Gem::Requirement
161
161
  none: false
162
162
  requirements:
163
163
  - - ~>
@@ -165,10 +165,10 @@ dependencies:
165
165
  version: '1.6'
166
166
  type: :development
167
167
  prerelease: false
168
- version_requirements: *2181007520
168
+ version_requirements: *2166218000
169
169
  - !ruby/object:Gem::Dependency
170
170
  name: redcarpet
171
- requirement: &2181007060 !ruby/object:Gem::Requirement
171
+ requirement: &2166121500 !ruby/object:Gem::Requirement
172
172
  none: false
173
173
  requirements:
174
174
  - - ~>
@@ -176,7 +176,7 @@ dependencies:
176
176
  version: '1.9'
177
177
  type: :development
178
178
  prerelease: false
179
- version_requirements: *2181007060
179
+ version_requirements: *2166121500
180
180
  description: Jekyll is a simple, blog aware, static site generator.
181
181
  email: matt.beale@madhatted.com
182
182
  executables: []
@@ -307,7 +307,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
307
307
  version: '0'
308
308
  segments:
309
309
  - 0
310
- hash: 1960019851315219458
310
+ hash: -4519138792738615429
311
311
  required_rubygems_version: !ruby/object:Gem::Requirement
312
312
  none: false
313
313
  requirements: