jekyll 1.5.1 → 2.0.0.alpha.1
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 +4 -4
- data/CONTRIBUTING.markdown +6 -6
- data/History.markdown +99 -23
- data/README.markdown +7 -3
- data/Rakefile +5 -5
- data/bin/jekyll +101 -116
- data/features/embed_filters.feature +13 -0
- data/features/include_tag.feature +11 -0
- data/features/markdown.feature +3 -3
- data/features/site_configuration.feature +34 -3
- data/features/step_definitions/jekyll_steps.rb +47 -34
- data/features/support/env.rb +25 -28
- data/jekyll.gemspec +38 -18
- data/lib/jekyll.rb +7 -15
- data/lib/jekyll/commands/build.rb +2 -0
- data/lib/jekyll/commands/serve.rb +11 -1
- data/lib/jekyll/configuration.rb +22 -6
- data/lib/jekyll/converter.rb +16 -16
- data/lib/jekyll/converters/markdown.rb +30 -15
- data/lib/jekyll/converters/markdown/maruku_parser.rb +4 -5
- data/lib/jekyll/converters/markdown/redcarpet_parser.rb +34 -3
- data/lib/jekyll/converters/sass.rb +58 -0
- data/lib/jekyll/converters/textile.rb +2 -2
- data/lib/jekyll/convertible.rb +25 -6
- data/lib/jekyll/core_ext.rb +0 -35
- data/lib/jekyll/deprecator.rb +2 -2
- data/lib/jekyll/entry_filter.rb +61 -25
- data/lib/jekyll/excerpt.rb +8 -6
- data/lib/jekyll/filters.rb +46 -2
- data/lib/jekyll/layout_reader.rb +40 -0
- data/lib/jekyll/mime.types +19 -9
- data/lib/jekyll/page.rb +6 -4
- data/lib/jekyll/post.rb +11 -18
- data/lib/jekyll/site.rb +34 -32
- data/lib/jekyll/tags/highlight.rb +26 -4
- data/lib/jekyll/tags/include.rb +29 -17
- data/lib/jekyll/tags/post_url.rb +10 -1
- data/lib/jekyll/url.rb +0 -2
- data/lib/site_template/_config.yml +1 -1
- data/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +1 -1
- data/lib/site_template/css/main.css +8 -1
- data/script/bootstrap +2 -0
- data/script/branding +11 -0
- data/script/cibuild +5 -0
- data/script/rebund +140 -0
- data/site/_config.yml +2 -2
- data/site/_data/docs.yml +44 -0
- data/site/{css → _includes/css}/gridism.css +0 -0
- data/site/_includes/css/normalize.css +1 -0
- data/site/{css → _includes/css}/pygments.css +2 -0
- data/site/{css → _includes/css}/style.css +10 -0
- data/site/_includes/docs_contents.html +4 -12
- data/site/_includes/docs_contents_mobile.html +4 -17
- data/site/_includes/docs_option.html +1 -1
- data/site/_includes/docs_ul.html +2 -2
- data/site/_includes/footer.html +1 -1
- data/site/_includes/top.html +1 -4
- data/site/_layouts/news_item.html +2 -2
- data/site/_posts/2013-07-24-jekyll-1-1-1-released.markdown +4 -4
- data/site/_posts/2013-09-14-jekyll-1-2-1-released.markdown +1 -1
- data/site/_posts/2013-10-28-jekyll-1-3-0-rc1-released.markdown +1 -1
- data/site/_posts/2013-12-09-jekyll-1-4-1-released.markdown +20 -0
- data/site/_posts/2014-01-13-jekyll-1-4-3-released.markdown +1 -2
- data/site/css/screen.css +27 -0
- data/site/docs/assets.md +46 -0
- data/site/docs/configuration.md +18 -4
- data/site/docs/contributing.md +2 -2
- data/site/docs/datafiles.md +6 -6
- data/site/docs/deployment-methods.md +5 -0
- data/site/docs/extras.md +38 -2
- data/site/docs/frontmatter.md +2 -1
- data/site/docs/history.md +0 -22
- data/site/docs/installation.md +7 -7
- data/site/docs/migrations.md +1 -1
- data/site/docs/plugins.md +11 -2
- data/site/docs/posts.md +25 -4
- data/site/docs/sites.md +1 -1
- data/site/docs/structure.md +1 -1
- data/site/docs/templates.md +13 -8
- data/site/docs/troubleshooting.md +8 -5
- data/site/docs/usage.md +11 -0
- data/site/docs/variables.md +18 -0
- data/site/docs/windows.md +44 -0
- data/test/helper.rb +5 -8
- data/test/source/_includes/include.html +1 -0
- data/test/source/_includes/sig.markdown +2 -2
- data/test/source/_posts/2013-12-17-include-variable-filters.markdown +21 -0
- data/test/source/_posts/2013-12-20-properties.text +11 -0
- data/test/source/_sass/_grid.scss +1 -0
- data/test/source/css/main.scss +4 -0
- data/test/source/js/coffeescript.coffee +10 -0
- data/test/source/properties.html +8 -0
- data/test/source/unpublished.html +7 -0
- data/test/test_coffeescript.rb +49 -0
- data/test/test_configuration.rb +29 -18
- data/test/test_convertible.rb +7 -9
- data/test/test_core_ext.rb +0 -22
- data/test/test_entry_filter.rb +36 -2
- data/test/test_excerpt.rb +43 -1
- data/test/test_filters.rb +44 -5
- data/test/test_generated_site.rb +5 -1
- data/test/test_layout_reader.rb +17 -0
- data/test/test_page.rb +28 -10
- data/test/test_post.rb +32 -15
- data/test/test_redcarpet.rb +19 -3
- data/test/test_sass.rb +122 -0
- data/test/test_site.rb +56 -7
- data/test/test_tags.rb +102 -51
- metadata +154 -80
- data/site/_posts/2014-03-24-jekyll-1-5-0-released.markdown +0 -19
- data/site/_posts/2014-03-27-jekyll-1-5-1-released.markdown +0 -26
- data/site/css/normalize.css +0 -1
- data/test/source/_posts/2014-01-06-permalink-traversal.md +0 -5
- data/test/source/exploit.md +0 -5
- data/test/test_path_sanitization.rb +0 -18
data/test/test_convertible.rb
CHANGED
@@ -36,16 +36,14 @@ class TestConvertible < Test::Unit::TestCase
|
|
36
36
|
assert_no_match /undefined class\/module DoesNotExist/, out
|
37
37
|
end
|
38
38
|
|
39
|
-
if
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
assert_equal({}, ret)
|
45
|
-
end
|
46
|
-
assert_match(/invalid byte sequence in UTF-8/, out)
|
47
|
-
assert_match(/#{File.join(@base, name)}/, out)
|
39
|
+
should "not parse if there is encoding error in file" do
|
40
|
+
name = 'broken_front_matter3.erb'
|
41
|
+
out = capture_stdout do
|
42
|
+
ret = @convertible.read_yaml(@base, name, :encoding => 'utf-8')
|
43
|
+
assert_equal({}, ret)
|
48
44
|
end
|
45
|
+
assert_match(/invalid byte sequence in UTF-8/, out)
|
46
|
+
assert_match(/#{File.join(@base, name)}/, out)
|
49
47
|
end
|
50
48
|
end
|
51
49
|
end
|
data/test/test_core_ext.rb
CHANGED
@@ -63,26 +63,4 @@ class TestCoreExt < Test::Unit::TestCase
|
|
63
63
|
end
|
64
64
|
|
65
65
|
end
|
66
|
-
|
67
|
-
context "enumerable" do
|
68
|
-
context "glob_include?" do
|
69
|
-
should "return false with no glob patterns" do
|
70
|
-
assert ![].glob_include?("a.txt")
|
71
|
-
end
|
72
|
-
|
73
|
-
should "return false with all not match path" do
|
74
|
-
data = ["a*", "b?"]
|
75
|
-
assert !data.glob_include?("ca.txt")
|
76
|
-
assert !data.glob_include?("ba.txt")
|
77
|
-
end
|
78
|
-
|
79
|
-
should "return true with match path" do
|
80
|
-
data = ["a*", "b?", "**/a*"]
|
81
|
-
assert data.glob_include?("a.txt")
|
82
|
-
assert data.glob_include?("ba")
|
83
|
-
assert data.glob_include?("c/a/a.txt")
|
84
|
-
assert data.glob_include?("c/a/b/a.txt")
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
66
|
end
|
data/test/test_entry_filter.rb
CHANGED
@@ -18,8 +18,8 @@ class TestEntryFilter < Test::Unit::TestCase
|
|
18
18
|
end
|
19
19
|
|
20
20
|
should "filter entries with exclude" do
|
21
|
-
excludes = %w[README TODO]
|
22
|
-
files = %w[index.html site.css .htaccess]
|
21
|
+
excludes = %w[README TODO vendor/bundle]
|
22
|
+
files = %w[index.html site.css .htaccess vendor]
|
23
23
|
|
24
24
|
@site.exclude = excludes + ["exclude*"]
|
25
25
|
assert_equal files, @site.filter_entries(excludes + files + ["excludeA"])
|
@@ -71,4 +71,38 @@ class TestEntryFilter < Test::Unit::TestCase
|
|
71
71
|
assert_not_equal [], site.static_files
|
72
72
|
end
|
73
73
|
end
|
74
|
+
|
75
|
+
context "#glob_include?" do
|
76
|
+
setup do
|
77
|
+
stub(Jekyll).configuration do
|
78
|
+
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir})
|
79
|
+
end
|
80
|
+
@site = Site.new(Jekyll.configuration)
|
81
|
+
@filter = EntryFilter.new(@site)
|
82
|
+
end
|
83
|
+
|
84
|
+
should "return false with no glob patterns" do
|
85
|
+
assert !@filter.glob_include?([], "a.txt")
|
86
|
+
end
|
87
|
+
|
88
|
+
should "return false with all not match path" do
|
89
|
+
data = ["a*", "b?"]
|
90
|
+
assert !@filter.glob_include?(data, "ca.txt")
|
91
|
+
assert !@filter.glob_include?(data, "ba.txt")
|
92
|
+
end
|
93
|
+
|
94
|
+
should "return true with match path" do
|
95
|
+
data = ["a*", "b?", "**/a*"]
|
96
|
+
assert @filter.glob_include?(data, "a.txt")
|
97
|
+
assert @filter.glob_include?(data, "ba")
|
98
|
+
assert @filter.glob_include?(data, "c/a/a.txt")
|
99
|
+
assert @filter.glob_include?(data, "c/a/b/a.txt")
|
100
|
+
end
|
101
|
+
|
102
|
+
should "match even if there is no leading slash" do
|
103
|
+
data = ['vendor/bundle']
|
104
|
+
assert @filter.glob_include?(data, '/vendor/bundle')
|
105
|
+
assert @filter.glob_include?(data, 'vendor/bundle')
|
106
|
+
end
|
107
|
+
end
|
74
108
|
end
|
data/test/test_excerpt.rb
CHANGED
@@ -35,6 +35,48 @@ class TestExcerpt < Test::Unit::TestCase
|
|
35
35
|
@excerpt = @post.send :extract_excerpt
|
36
36
|
end
|
37
37
|
|
38
|
+
context "#include(string)" do
|
39
|
+
|
40
|
+
setup do
|
41
|
+
@excerpt.output = "Here is a fake output stub"
|
42
|
+
end
|
43
|
+
|
44
|
+
should "return true only if an excerpt output contains a specified string" do
|
45
|
+
assert @excerpt.include?("fake output")
|
46
|
+
refute @excerpt.include?("real output")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
context "#id" do
|
51
|
+
should "contain the UID for the post" do
|
52
|
+
assert_equal @excerpt.id, "#{@post.id}/#excerpt"
|
53
|
+
end
|
54
|
+
should "return a string" do
|
55
|
+
assert_same @post.id.class, String
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
context "#to_s" do
|
60
|
+
should "return its content if no output present" do
|
61
|
+
assert_equal @excerpt.content, @excerpt.to_s
|
62
|
+
end
|
63
|
+
|
64
|
+
should "return its output if output present" do
|
65
|
+
@excerpt.output = "Fake Output"
|
66
|
+
assert_equal @excerpt.output, @excerpt.to_s
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
context "#inspect" do
|
71
|
+
should "contain the excerpt id as a shorthand string identifier" do
|
72
|
+
assert_equal @excerpt.inspect, "<Excerpt: #{@excerpt.id}>"
|
73
|
+
end
|
74
|
+
|
75
|
+
should "return a string" do
|
76
|
+
assert_same @post.id.class, String
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
38
80
|
context "#to_liquid" do
|
39
81
|
should "contain the proper page data to mimick the post liquid" do
|
40
82
|
assert_equal "Post Excerpt with Layout", @excerpt.to_liquid["title"]
|
@@ -66,7 +108,7 @@ class TestExcerpt < Test::Unit::TestCase
|
|
66
108
|
end
|
67
109
|
|
68
110
|
should "be the first paragraph of the page" do
|
69
|
-
assert_equal "<p>First paragraph with <a href=\"http://www.jekyllrb.com/\">link ref</a>.</p
|
111
|
+
assert_equal "<p>First paragraph with <a href=\"http://www.jekyllrb.com/\">link ref</a>.</p>\n\n", @extracted_excerpt.content
|
70
112
|
end
|
71
113
|
|
72
114
|
should "link properly" do
|
data/test/test_filters.rb
CHANGED
@@ -3,18 +3,24 @@ require 'helper'
|
|
3
3
|
class TestFilters < Test::Unit::TestCase
|
4
4
|
class JekyllFilter
|
5
5
|
include Jekyll::Filters
|
6
|
+
attr_accessor :site, :context
|
6
7
|
|
7
|
-
def initialize
|
8
|
-
site = Jekyll::Site.new(Jekyll.configuration(
|
9
|
-
@context = Liquid::Context.new({}, {}, { :site => site })
|
8
|
+
def initialize(opts = {})
|
9
|
+
@site = Jekyll::Site.new(Jekyll.configuration(opts))
|
10
|
+
@context = Liquid::Context.new({}, {}, { :site => @site })
|
10
11
|
end
|
11
12
|
end
|
12
13
|
|
13
14
|
context "filters" do
|
14
15
|
setup do
|
15
|
-
@filter = JekyllFilter.new
|
16
|
+
@filter = JekyllFilter.new({"source" => source_dir, "destination" => dest_dir})
|
16
17
|
@sample_time = Time.utc(2013, 03, 27, 11, 22, 33)
|
17
18
|
@time_as_string = "September 11, 2001 12:46:30 -0000"
|
19
|
+
@array_of_objects = [
|
20
|
+
{ "color" => "red", "size" => "large" },
|
21
|
+
{ "color" => "red", "size" => "medium" },
|
22
|
+
{ "color" => "blue", "size" => "medium" }
|
23
|
+
]
|
18
24
|
end
|
19
25
|
|
20
26
|
should "textilize with simple string" do
|
@@ -22,7 +28,7 @@ class TestFilters < Test::Unit::TestCase
|
|
22
28
|
end
|
23
29
|
|
24
30
|
should "markdownify with simple string" do
|
25
|
-
assert_equal "<p>something <strong>really</strong> simple</p
|
31
|
+
assert_equal "<p>something <strong>really</strong> simple</p>\n", @filter.markdownify("something **really** simple")
|
26
32
|
end
|
27
33
|
|
28
34
|
should "convert array to sentence string with no args" do
|
@@ -109,5 +115,38 @@ class TestFilters < Test::Unit::TestCase
|
|
109
115
|
assert_equal "[{\"name\":\"Jack\"},{\"name\":\"Smith\"}]", @filter.jsonify([{:name => 'Jack'}, {:name => 'Smith'}])
|
110
116
|
end
|
111
117
|
end
|
118
|
+
|
119
|
+
context "group_by filter" do
|
120
|
+
should "successfully group array of Jekyll::Page's" do
|
121
|
+
@filter.site.process
|
122
|
+
grouping = @filter.group_by(@filter.site.pages, "layout")
|
123
|
+
grouping.each do |g|
|
124
|
+
assert ["default", "nil", ""].include?(g["name"]), "#{g['name']} isn't a valid grouping."
|
125
|
+
case g["name"]
|
126
|
+
when "default"
|
127
|
+
assert g["items"].is_a?(Array), "The list of grouped items for 'default' is not an Array."
|
128
|
+
assert_equal 4, g["items"].size
|
129
|
+
when "nil"
|
130
|
+
assert g["items"].is_a?(Array), "The list of grouped items for 'nil' is not an Array."
|
131
|
+
assert_equal 2, g["items"].size
|
132
|
+
when ""
|
133
|
+
assert g["items"].is_a?(Array), "The list of grouped items for '' is not an Array."
|
134
|
+
assert_equal 8, g["items"].size
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
context "where filter" do
|
141
|
+
should "return any input that is not an array" do
|
142
|
+
assert_equal Hash.new, @filter.where(Hash.new, nil, nil)
|
143
|
+
assert_equal "some string", @filter.where("some string", "la", "le")
|
144
|
+
end
|
145
|
+
|
146
|
+
should "filter objects appropriately" do
|
147
|
+
assert_equal 2, @filter.where(@array_of_objects, "color", "red").length
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
112
151
|
end
|
113
152
|
end
|
data/test/test_generated_site.rb
CHANGED
@@ -14,7 +14,7 @@ class TestGeneratedSite < Test::Unit::TestCase
|
|
14
14
|
end
|
15
15
|
|
16
16
|
should "ensure post count is as expected" do
|
17
|
-
assert_equal
|
17
|
+
assert_equal 38, @site.posts.size
|
18
18
|
end
|
19
19
|
|
20
20
|
should "insert site.posts into the index" do
|
@@ -32,6 +32,10 @@ class TestGeneratedSite < Test::Unit::TestCase
|
|
32
32
|
assert_equal "published.html", published.first
|
33
33
|
end
|
34
34
|
|
35
|
+
should "hide unpublished page" do
|
36
|
+
assert !File.exists?(dest_dir('/unpublished.html'))
|
37
|
+
end
|
38
|
+
|
35
39
|
should "not copy _posts directory" do
|
36
40
|
assert !File.exist?(dest_dir('_posts'))
|
37
41
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestLayoutReader < Test::Unit::TestCase
|
4
|
+
context "reading layouts" do
|
5
|
+
setup do
|
6
|
+
stub(Jekyll).configuration do
|
7
|
+
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir})
|
8
|
+
end
|
9
|
+
@site = Site.new(Jekyll.configuration)
|
10
|
+
end
|
11
|
+
|
12
|
+
should "read layouts" do
|
13
|
+
layouts = LayoutReader.new(@site).read
|
14
|
+
assert_equal ["default", "simple", "post/simple"].sort, layouts.keys.sort
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/test/test_page.rb
CHANGED
@@ -25,6 +25,11 @@ class TestPage < Test::Unit::TestCase
|
|
25
25
|
assert_equal "/contacts.html", @page.url
|
26
26
|
end
|
27
27
|
|
28
|
+
should "not published when published yaml is false" do
|
29
|
+
@page = setup_page("unpublished.html")
|
30
|
+
assert_equal false, @page.published?
|
31
|
+
end
|
32
|
+
|
28
33
|
context "in a directory hierarchy" do
|
29
34
|
should "create url based on filename" do
|
30
35
|
@page = setup_page('/contacts', 'bar.html')
|
@@ -47,6 +52,29 @@ class TestPage < Test::Unit::TestCase
|
|
47
52
|
assert_equal "deal.with.dots", @page.basename
|
48
53
|
end
|
49
54
|
|
55
|
+
should "make properties accessible through #[]" do
|
56
|
+
page = setup_page('properties.html')
|
57
|
+
attrs = {
|
58
|
+
content: "All the properties.\n",
|
59
|
+
dir: "/properties/",
|
60
|
+
excerpt: nil,
|
61
|
+
foo: 'bar',
|
62
|
+
layout: 'default',
|
63
|
+
name: "properties.html",
|
64
|
+
path: "properties.html",
|
65
|
+
permalink: '/properties/',
|
66
|
+
published: nil,
|
67
|
+
title: 'Properties Page',
|
68
|
+
url: "/properties/"
|
69
|
+
}
|
70
|
+
|
71
|
+
attrs.each do |attr, val|
|
72
|
+
attr_str = attr.to_s
|
73
|
+
result = page[attr_str]
|
74
|
+
assert_equal val, result, "For <page[\"#{attr_str}\"]>:"
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
50
78
|
context "with pretty url style" do
|
51
79
|
setup do
|
52
80
|
@site.permalink_style = :pretty
|
@@ -101,16 +129,6 @@ class TestPage < Test::Unit::TestCase
|
|
101
129
|
assert_equal @page.permalink, @page.url
|
102
130
|
assert_equal "/about/", @page.dir
|
103
131
|
end
|
104
|
-
|
105
|
-
should "not be writable outside of destination" do
|
106
|
-
unexpected = File.expand_path("../../../baddie.html", dest_dir)
|
107
|
-
File.delete unexpected if File.exist?(unexpected)
|
108
|
-
page = setup_page("exploit.md")
|
109
|
-
do_render(page)
|
110
|
-
page.write(dest_dir)
|
111
|
-
|
112
|
-
assert !File.exist?(unexpected)
|
113
|
-
end
|
114
132
|
end
|
115
133
|
|
116
134
|
context "with specified layout of nil" do
|
data/test/test_post.rb
CHANGED
@@ -25,6 +25,34 @@ class TestPost < Test::Unit::TestCase
|
|
25
25
|
assert !Post.valid?("blah")
|
26
26
|
end
|
27
27
|
|
28
|
+
should "make properties accessible through #[]" do
|
29
|
+
post = setup_post('2013-12-20-properties.text')
|
30
|
+
|
31
|
+
attrs = {
|
32
|
+
categories: %w(foo bar baz),
|
33
|
+
content: "All the properties.\n\nPlus an excerpt.\n",
|
34
|
+
date: Time.new(2013, 12, 20),
|
35
|
+
dir: "/foo/bar/baz/2013/12/20",
|
36
|
+
excerpt: "All the properties.\n\n",
|
37
|
+
foo: 'bar',
|
38
|
+
id: "/foo/bar/baz/2013/12/20/properties",
|
39
|
+
layout: 'default',
|
40
|
+
name: nil,
|
41
|
+
# path: "properties.html",
|
42
|
+
permalink: nil,
|
43
|
+
published: nil,
|
44
|
+
tags: %w(ay bee cee),
|
45
|
+
title: 'Properties Post',
|
46
|
+
url: "/foo/bar/baz/2013/12/20/properties.html"
|
47
|
+
}
|
48
|
+
|
49
|
+
attrs.each do |attr, val|
|
50
|
+
attr_str = attr.to_s
|
51
|
+
result = post[attr_str]
|
52
|
+
assert_equal val, result, "For <post[\"#{attr_str}\"]>:"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
28
56
|
context "processing posts" do
|
29
57
|
setup do
|
30
58
|
@post = Post.allocate
|
@@ -75,17 +103,6 @@ class TestPost < Test::Unit::TestCase
|
|
75
103
|
assert_equal "/my_category/permalinked-post", @post.url
|
76
104
|
end
|
77
105
|
|
78
|
-
should "not be writable outside of destination" do
|
79
|
-
unexpected = File.expand_path("../../../baddie.html", dest_dir)
|
80
|
-
File.delete unexpected if File.exist?(unexpected)
|
81
|
-
post = setup_post("2014-01-06-permalink-traversal.md")
|
82
|
-
do_render(post)
|
83
|
-
post.write(dest_dir)
|
84
|
-
|
85
|
-
assert !File.exist?(unexpected)
|
86
|
-
assert File.exist?(File.expand_path("baddie.html", dest_dir))
|
87
|
-
end
|
88
|
-
|
89
106
|
context "with CRLF linebreaks" do
|
90
107
|
setup do
|
91
108
|
@real_file = "2009-05-24-yaml-linebreak.markdown"
|
@@ -295,7 +312,7 @@ class TestPost < Test::Unit::TestCase
|
|
295
312
|
end
|
296
313
|
|
297
314
|
should "return rendered HTML" do
|
298
|
-
assert_equal "<p>First paragraph with <a href=\"http://www.jekyllrb.com/\">link ref</a>.</p
|
315
|
+
assert_equal "<p>First paragraph with <a href=\"http://www.jekyllrb.com/\">link ref</a>.</p>\n\n",
|
299
316
|
@post.excerpt
|
300
317
|
end
|
301
318
|
|
@@ -370,12 +387,12 @@ class TestPost < Test::Unit::TestCase
|
|
370
387
|
context "initializing posts" do
|
371
388
|
should "publish when published yaml is no specified" do
|
372
389
|
post = setup_post("2008-02-02-published.textile")
|
373
|
-
assert_equal true, post.published
|
390
|
+
assert_equal true, post.published?
|
374
391
|
end
|
375
392
|
|
376
393
|
should "not published when published yaml is false" do
|
377
394
|
post = setup_post("2008-02-02-not-published.textile")
|
378
|
-
assert_equal false, post.published
|
395
|
+
assert_equal false, post.published?
|
379
396
|
end
|
380
397
|
|
381
398
|
should "recognize date in yaml" do
|
@@ -515,7 +532,7 @@ class TestPost < Test::Unit::TestCase
|
|
515
532
|
post.site.source = File.join(File.dirname(__FILE__), 'source')
|
516
533
|
do_render(post)
|
517
534
|
|
518
|
-
assert_equal "<<< <hr />\n<p>Tom Preston-Werner
|
535
|
+
assert_equal "<<< <hr />\n<p>Tom Preston-Werner\ngithub.com/mojombo</p>\n\n<p>This <em>is</em> cool</p>\n >>>", post.output
|
519
536
|
end
|
520
537
|
|
521
538
|
should "render date specified in front matter properly" do
|
data/test/test_redcarpet.rb
CHANGED
@@ -28,7 +28,7 @@ class TestRedcarpet < Test::Unit::TestCase
|
|
28
28
|
|
29
29
|
context "with pygments enabled" do
|
30
30
|
setup do
|
31
|
-
@markdown = Converters::Markdown.new @config.merge({ '
|
31
|
+
@markdown = Converters::Markdown.new @config.merge({ 'highlighter' => 'pygments' })
|
32
32
|
end
|
33
33
|
|
34
34
|
should "render fenced code blocks with syntax highlighting" do
|
@@ -42,9 +42,25 @@ puts "Hello world"
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
context "with
|
45
|
+
context "with rouge enabled" do
|
46
46
|
setup do
|
47
|
-
@markdown = Converters::Markdown.new @config.merge({ '
|
47
|
+
@markdown = Converters::Markdown.new @config.merge({ 'highlighter' => 'rouge' })
|
48
|
+
end
|
49
|
+
|
50
|
+
should "render fenced code blocks with syntax highlighting" do
|
51
|
+
assert_equal "<div class=\"highlight\"><pre><code class=\"ruby language-ruby\" data-lang=\"ruby\"><span class=\"nb\">puts</span> <span class=\"s2\">\"Hello world\"</span>\n</code></pre></div>", @markdown.convert(
|
52
|
+
<<-EOS
|
53
|
+
```ruby
|
54
|
+
puts "Hello world"
|
55
|
+
```
|
56
|
+
EOS
|
57
|
+
).strip
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
context "without any highlighter" do
|
62
|
+
setup do
|
63
|
+
@markdown = Converters::Markdown.new @config.merge({ 'highlighter' => nil })
|
48
64
|
end
|
49
65
|
|
50
66
|
should "render fenced code blocks without syntax highlighting" do
|