jekyll 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of jekyll might be problematic. Click here for more details.
- checksums.yaml +8 -8
- data/History.markdown +46 -0
- data/Rakefile +35 -1
- data/bin/jekyll +6 -4
- data/features/create_sites.feature +8 -8
- data/features/drafts.feature +3 -3
- data/features/embed_filters.feature +5 -5
- data/features/markdown.feature +2 -2
- data/features/pagination.feature +8 -8
- data/features/permalinks.feature +5 -5
- data/features/post_data.feature +23 -23
- data/features/site_configuration.feature +9 -9
- data/features/site_data.feature +14 -14
- data/features/step_definitions/jekyll_steps.rb +16 -27
- data/features/support/env.rb +11 -6
- data/jekyll.gemspec +7 -4
- data/lib/jekyll.rb +7 -2
- data/lib/jekyll/command.rb +3 -3
- data/lib/jekyll/commands/build.rb +5 -5
- data/lib/jekyll/commands/doctor.rb +2 -2
- data/lib/jekyll/commands/new.rb +8 -3
- data/lib/jekyll/configuration.rb +31 -6
- data/lib/jekyll/converters/markdown/maruku_parser.rb +11 -7
- data/lib/jekyll/convertible.rb +4 -7
- data/lib/jekyll/deprecator.rb +2 -2
- data/lib/jekyll/filters.rb +12 -2
- data/lib/jekyll/generators/pagination.rb +3 -2
- data/lib/jekyll/layout.rb +3 -0
- data/lib/jekyll/post.rb +1 -23
- data/lib/jekyll/related_posts.rb +58 -0
- data/lib/jekyll/site.rb +2 -4
- data/lib/jekyll/{logger.rb → stevenson.rb} +26 -12
- data/lib/jekyll/tags/gist.rb +13 -3
- data/lib/site_template/_layouts/default.html +1 -1
- data/lib/site_template/_layouts/post.html +1 -1
- data/lib/site_template/css/main.css +7 -7
- data/site/_includes/docs_contents.html +3 -0
- data/site/css/pygments.css +1 -1
- data/site/css/style.css +9 -2
- data/site/docs/deployment-methods.md +1 -1
- data/site/docs/frontmatter.md +10 -0
- data/site/docs/history.md +536 -0
- data/site/docs/installation.md +2 -4
- data/site/docs/migrations.md +57 -58
- data/site/docs/plugins.md +3 -0
- data/site/docs/posts.md +24 -2
- data/site/docs/templates.md +50 -3
- data/site/docs/upgrading.md +45 -29
- data/test/source/_layouts/default.html +1 -1
- data/test/test_configuration.rb +15 -3
- data/test/test_page.rb +1 -1
- data/test/test_pager.rb +7 -0
- data/test/test_post.rb +11 -11
- data/test/test_redcloth.rb +3 -3
- data/test/test_related_posts.rb +41 -0
- data/test/test_site.rb +6 -6
- data/test/test_tags.rb +40 -0
- metadata +9 -5
data/test/test_configuration.rb
CHANGED
@@ -51,9 +51,11 @@ class TestConfiguration < Test::Unit::TestCase
|
|
51
51
|
context "#backwards_compatibilize" do
|
52
52
|
setup do
|
53
53
|
@config = Configuration[{
|
54
|
-
"auto"
|
55
|
-
"watch"
|
56
|
-
"server"
|
54
|
+
"auto" => true,
|
55
|
+
"watch" => true,
|
56
|
+
"server" => true,
|
57
|
+
"exclude" => "READ-ME.md, Gemfile,CONTRIBUTING.hello.markdown",
|
58
|
+
"include" => "STOP_THE_PRESSES.txt,.heloses, .git"
|
57
59
|
}]
|
58
60
|
end
|
59
61
|
should "unset 'auto' and 'watch'" do
|
@@ -66,6 +68,16 @@ class TestConfiguration < Test::Unit::TestCase
|
|
66
68
|
assert @config.has_key?("server")
|
67
69
|
assert !@config.backwards_compatibilize.has_key?("server")
|
68
70
|
end
|
71
|
+
should "transform string exclude into an array" do
|
72
|
+
assert @config.has_key?("exclude")
|
73
|
+
assert @config.backwards_compatibilize.has_key?("exclude")
|
74
|
+
assert_equal @config.backwards_compatibilize["exclude"], %w[READ-ME.md Gemfile CONTRIBUTING.hello.markdown]
|
75
|
+
end
|
76
|
+
should "transform string include into an array" do
|
77
|
+
assert @config.has_key?("include")
|
78
|
+
assert @config.backwards_compatibilize.has_key?("include")
|
79
|
+
assert_equal @config.backwards_compatibilize["include"], %w[STOP_THE_PRESSES.txt .heloses .git]
|
80
|
+
end
|
69
81
|
end
|
70
82
|
context "loading configuration" do
|
71
83
|
setup do
|
data/test/test_page.rb
CHANGED
data/test/test_pager.rb
CHANGED
@@ -11,6 +11,13 @@ class TestPager < Test::Unit::TestCase
|
|
11
11
|
assert_equal(3, Pager.calculate_pages([1,2,3,4,5], '2'))
|
12
12
|
end
|
13
13
|
|
14
|
+
should "determine the pagination path" do
|
15
|
+
assert_nil(Pager.paginate_path(Jekyll::Configuration::DEFAULTS, 1))
|
16
|
+
assert_equal("page2", Pager.paginate_path(Jekyll::Configuration::DEFAULTS, 2))
|
17
|
+
assert_nil(Pager.paginate_path(Jekyll::Configuration::DEFAULTS.merge('paginate_path' => '/blog/page-:num'), 1))
|
18
|
+
assert_equal("page-2", Pager.paginate_path(Jekyll::Configuration::DEFAULTS.merge('paginate_path' => '/blog/page-:num'), 2))
|
19
|
+
end
|
20
|
+
|
14
21
|
context "pagination disabled" do
|
15
22
|
setup do
|
16
23
|
stub(Jekyll).configuration do
|
data/test/test_post.rb
CHANGED
@@ -139,7 +139,7 @@ class TestPost < Test::Unit::TestCase
|
|
139
139
|
assert_equal "/2013/2008/09/09/foo-bar.html", @post.url
|
140
140
|
end
|
141
141
|
end
|
142
|
-
|
142
|
+
|
143
143
|
context "with specified layout of nil" do
|
144
144
|
setup do
|
145
145
|
file = '2013-01-12-nil-layout.textile'
|
@@ -422,7 +422,7 @@ class TestPost < Test::Unit::TestCase
|
|
422
422
|
post = setup_post("2009-01-27-empty-categories.textile")
|
423
423
|
assert_equal [], post.categories
|
424
424
|
end
|
425
|
-
|
425
|
+
|
426
426
|
should "recognize number category in yaml" do
|
427
427
|
post = setup_post("2013-05-10-number-category.textile")
|
428
428
|
assert post.categories.include?('2013')
|
@@ -440,7 +440,7 @@ class TestPost < Test::Unit::TestCase
|
|
440
440
|
assert post.tags.include?('cooking')
|
441
441
|
assert post.tags.include?('pizza')
|
442
442
|
end
|
443
|
-
|
443
|
+
|
444
444
|
should "recognize empty tag in yaml" do
|
445
445
|
post = setup_post("2009-05-18-empty-tag.textile")
|
446
446
|
assert_equal [], post.tags
|
@@ -528,46 +528,46 @@ class TestPost < Test::Unit::TestCase
|
|
528
528
|
assert_equal ['foo'], post.categories
|
529
529
|
end
|
530
530
|
end
|
531
|
-
|
531
|
+
|
532
532
|
context "converter file extension settings" do
|
533
533
|
setup do
|
534
534
|
stub(Jekyll).configuration { Jekyll::Configuration::DEFAULTS }
|
535
535
|
@site = Site.new(Jekyll.configuration)
|
536
536
|
end
|
537
|
-
|
537
|
+
|
538
538
|
should "process .md as markdown under default configuration" do
|
539
539
|
post = setup_post '2011-04-12-md-extension.md'
|
540
540
|
conv = post.converter
|
541
541
|
assert conv.kind_of? Jekyll::Converters::Markdown
|
542
542
|
end
|
543
|
-
|
543
|
+
|
544
544
|
should "process .text as identity under default configuration" do
|
545
545
|
post = setup_post '2011-04-12-text-extension.text'
|
546
546
|
conv = post.converter
|
547
547
|
assert conv.kind_of? Jekyll::Converters::Identity
|
548
548
|
end
|
549
|
-
|
549
|
+
|
550
550
|
should "process .text as markdown under alternate configuration" do
|
551
551
|
@site.config['markdown_ext'] = 'markdown,mdw,mdwn,md,text'
|
552
552
|
post = setup_post '2011-04-12-text-extension.text'
|
553
553
|
conv = post.converter
|
554
554
|
assert conv.kind_of? Jekyll::Converters::Markdown
|
555
555
|
end
|
556
|
-
|
556
|
+
|
557
557
|
should "process .md as markdown under alternate configuration" do
|
558
558
|
@site.config['markdown_ext'] = 'markdown,mkd,mkdn,md,text'
|
559
559
|
post = setup_post '2011-04-12-text-extension.text'
|
560
560
|
conv = post.converter
|
561
561
|
assert conv.kind_of? Jekyll::Converters::Markdown
|
562
562
|
end
|
563
|
-
|
563
|
+
|
564
564
|
should "process .text as textile under alternate configuration" do
|
565
565
|
@site.config['textile_ext'] = 'textile,text'
|
566
566
|
post = setup_post '2011-04-12-text-extension.text'
|
567
567
|
conv = post.converter
|
568
568
|
assert conv.kind_of? Jekyll::Converters::Textile
|
569
569
|
end
|
570
|
-
|
570
|
+
|
571
571
|
end
|
572
|
-
|
572
|
+
|
573
573
|
end
|
data/test/test_redcloth.rb
CHANGED
@@ -6,7 +6,7 @@ class TestRedCloth < Test::Unit::TestCase
|
|
6
6
|
setup do
|
7
7
|
@textile = Converters::Textile.new
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
should "preserve single line breaks in HTML output" do
|
11
11
|
assert_equal "<p>line1<br />\nline2</p>", @textile.convert("p. line1\nline2").strip
|
12
12
|
end
|
@@ -19,7 +19,7 @@ class TestRedCloth < Test::Unit::TestCase
|
|
19
19
|
}
|
20
20
|
@textile = Converters::Textile.new config
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
should "preserve single line breaks in HTML output" do
|
24
24
|
assert_equal "<p>line1<br />\nline2</p>", @textile.convert("p. line1\nline2").strip
|
25
25
|
end
|
@@ -34,7 +34,7 @@ class TestRedCloth < Test::Unit::TestCase
|
|
34
34
|
}
|
35
35
|
@textile = Converters::Textile.new config
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
should "preserve single line breaks in HTML output" do
|
39
39
|
assert_equal "<p>line1<br />\nline2</p>", @textile.convert("p. line1\nline2").strip
|
40
40
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestRelatedPosts < Test::Unit::TestCase
|
4
|
+
context "building related posts without lsi" do
|
5
|
+
setup do
|
6
|
+
stub(Jekyll).configuration do
|
7
|
+
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir,
|
8
|
+
'destination' => dest_dir})
|
9
|
+
end
|
10
|
+
@site = Site.new(Jekyll.configuration)
|
11
|
+
end
|
12
|
+
|
13
|
+
should "use the most recent posts for related posts" do
|
14
|
+
@site.reset
|
15
|
+
@site.read
|
16
|
+
assert_equal @site.posts[0..9], Jekyll::RelatedPosts.new(@site.posts.last).build
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context "building related posts with lsi" do
|
21
|
+
setup do
|
22
|
+
stub(Jekyll).configuration do
|
23
|
+
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir,
|
24
|
+
'destination' => dest_dir,
|
25
|
+
'lsi' => true})
|
26
|
+
end
|
27
|
+
@site = Site.new(Jekyll.configuration)
|
28
|
+
end
|
29
|
+
|
30
|
+
should "use lsi for the related posts" do
|
31
|
+
@site.reset
|
32
|
+
@site.read
|
33
|
+
require 'classifier'
|
34
|
+
any_instance_of(::Classifier::LSI) do |c|
|
35
|
+
stub(c).find_related { @site.posts[-1..-9] }
|
36
|
+
stub(c).build_index
|
37
|
+
end
|
38
|
+
assert_equal @site.posts[-1..-9], Jekyll::RelatedPosts.new(@site.posts.last).build
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/test/test_site.rb
CHANGED
@@ -195,7 +195,7 @@ class TestSite < Test::Unit::TestCase
|
|
195
195
|
@site.exclude = excludes + ["exclude*"]
|
196
196
|
assert_equal files, @site.filter_entries(excludes + files + ["excludeA"])
|
197
197
|
end
|
198
|
-
|
198
|
+
|
199
199
|
should "not filter entries within include" do
|
200
200
|
includes = %w[_index.html .htaccess include*]
|
201
201
|
files = %w[index.html _index.html .htaccess includeA]
|
@@ -284,7 +284,7 @@ class TestSite < Test::Unit::TestCase
|
|
284
284
|
File.open(dest_dir('.svn/HEAD'), 'w')
|
285
285
|
File.open(dest_dir('.hg/HEAD'), 'w')
|
286
286
|
end
|
287
|
-
|
287
|
+
|
288
288
|
teardown do
|
289
289
|
FileUtils.rm_f(dest_dir('obsolete.html'))
|
290
290
|
FileUtils.rm_rf(dest_dir('qux'))
|
@@ -293,7 +293,7 @@ class TestSite < Test::Unit::TestCase
|
|
293
293
|
FileUtils.rm_rf(dest_dir('.svn'))
|
294
294
|
FileUtils.rm_rf(dest_dir('.hg'))
|
295
295
|
end
|
296
|
-
|
296
|
+
|
297
297
|
should 'remove orphaned files in destination' do
|
298
298
|
@site.process
|
299
299
|
assert !File.exist?(dest_dir('obsolete.html'))
|
@@ -317,7 +317,7 @@ class TestSite < Test::Unit::TestCase
|
|
317
317
|
assert File.exist?(dest_dir('.svn/HEAD'))
|
318
318
|
end
|
319
319
|
end
|
320
|
-
|
320
|
+
|
321
321
|
context 'with an invalid markdown processor in the configuration' do
|
322
322
|
should 'not throw an error at initialization time' do
|
323
323
|
bad_processor = 'not a processor name'
|
@@ -325,7 +325,7 @@ class TestSite < Test::Unit::TestCase
|
|
325
325
|
Site.new(Jekyll.configuration.merge({ 'markdown' => bad_processor }))
|
326
326
|
end
|
327
327
|
end
|
328
|
-
|
328
|
+
|
329
329
|
should 'throw FatalException at process time' do
|
330
330
|
bad_processor = 'not a processor name'
|
331
331
|
s = Site.new(Jekyll.configuration.merge({ 'markdown' => bad_processor }))
|
@@ -334,6 +334,6 @@ class TestSite < Test::Unit::TestCase
|
|
334
334
|
end
|
335
335
|
end
|
336
336
|
end
|
337
|
-
|
337
|
+
|
338
338
|
end
|
339
339
|
end
|
data/test/test_tags.rb
CHANGED
@@ -253,6 +253,46 @@ CONTENT
|
|
253
253
|
end
|
254
254
|
end
|
255
255
|
|
256
|
+
context "for private gist" do
|
257
|
+
context "when valid" do
|
258
|
+
setup do
|
259
|
+
@gist = "mattr-/24081a1d93d2898ecf0f"
|
260
|
+
@filename = "myfile.ext"
|
261
|
+
content = <<CONTENT
|
262
|
+
---
|
263
|
+
title: My Cool Gist
|
264
|
+
---
|
265
|
+
|
266
|
+
{% gist #{@gist} #{@filename} %}
|
267
|
+
CONTENT
|
268
|
+
create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true})
|
269
|
+
end
|
270
|
+
|
271
|
+
should "write script tag with specific file in gist" do
|
272
|
+
assert_match "<script src='https://gist.github.com/#{@gist}.js?file=#{@filename}'>\s</script>", @result
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
context "when invalid" do
|
277
|
+
setup do
|
278
|
+
@gist = "mattr-24081a1d93d2898ecf0f"
|
279
|
+
@filename = "myfile.ext"
|
280
|
+
content = <<CONTENT
|
281
|
+
---
|
282
|
+
title: My Cool Gist
|
283
|
+
---
|
284
|
+
|
285
|
+
{% gist #{@gist} #{@filename} %}
|
286
|
+
CONTENT
|
287
|
+
create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true})
|
288
|
+
end
|
289
|
+
|
290
|
+
should "write script tag with specific file in gist" do
|
291
|
+
assert_match "Error parsing gist id", @result
|
292
|
+
end
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
256
296
|
context "with specific file" do
|
257
297
|
setup do
|
258
298
|
@gist = 358471
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Preston-Werner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|
@@ -198,14 +198,14 @@ dependencies:
|
|
198
198
|
requirements:
|
199
199
|
- - ~>
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version:
|
201
|
+
version: 1.0.0
|
202
202
|
type: :development
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
206
|
- - ~>
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
208
|
+
version: 1.0.0
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: cucumber
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -363,13 +363,14 @@ files:
|
|
363
363
|
- lib/jekyll/generator.rb
|
364
364
|
- lib/jekyll/generators/pagination.rb
|
365
365
|
- lib/jekyll/layout.rb
|
366
|
-
- lib/jekyll/logger.rb
|
367
366
|
- lib/jekyll/mime.types
|
368
367
|
- lib/jekyll/page.rb
|
369
368
|
- lib/jekyll/plugin.rb
|
370
369
|
- lib/jekyll/post.rb
|
370
|
+
- lib/jekyll/related_posts.rb
|
371
371
|
- lib/jekyll/site.rb
|
372
372
|
- lib/jekyll/static_file.rb
|
373
|
+
- lib/jekyll/stevenson.rb
|
373
374
|
- lib/jekyll/tags/gist.rb
|
374
375
|
- lib/jekyll/tags/highlight.rb
|
375
376
|
- lib/jekyll/tags/include.rb
|
@@ -408,6 +409,7 @@ files:
|
|
408
409
|
- site/docs/frontmatter.md
|
409
410
|
- site/docs/github-pages.md
|
410
411
|
- site/docs/heroku.md
|
412
|
+
- site/docs/history.md
|
411
413
|
- site/docs/index.md
|
412
414
|
- site/docs/installation.md
|
413
415
|
- site/docs/migrations.md
|
@@ -505,6 +507,7 @@ files:
|
|
505
507
|
- test/test_rdiscount.rb
|
506
508
|
- test/test_redcarpet.rb
|
507
509
|
- test/test_redcloth.rb
|
510
|
+
- test/test_related_posts.rb
|
508
511
|
- test/test_site.rb
|
509
512
|
- test/test_tags.rb
|
510
513
|
homepage: http://github.com/mojombo/jekyll
|
@@ -547,5 +550,6 @@ test_files:
|
|
547
550
|
- test/test_rdiscount.rb
|
548
551
|
- test/test_redcarpet.rb
|
549
552
|
- test/test_redcloth.rb
|
553
|
+
- test/test_related_posts.rb
|
550
554
|
- test/test_site.rb
|
551
555
|
- test/test_tags.rb
|