jekyll 2.0.3 → 2.1.0
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/.travis.yml +2 -2
- data/CONTRIBUTING.markdown +2 -2
- data/History.markdown +86 -0
- data/README.markdown +5 -30
- data/Rakefile +4 -9
- data/docs/jp/CONTRIBUTING.jp.markdown +2 -2
- data/docs/jp/README.jp.markdown +1 -2
- data/features/collections.feature +40 -3
- data/features/data.feature +41 -1
- data/features/frontmatter_defaults.feature +57 -0
- data/features/post_data.feature +12 -0
- data/features/rendering.feature +34 -0
- data/features/step_definitions/jekyll_steps.rb +5 -1
- data/features/support/env.rb +0 -3
- data/jekyll.gemspec +6 -5
- data/lib/jekyll.rb +18 -1
- data/lib/jekyll/cleaner.rb +22 -2
- data/lib/jekyll/collection.rb +9 -2
- data/lib/jekyll/command.rb +20 -10
- data/lib/jekyll/commands/build.rb +10 -47
- data/lib/jekyll/commands/serve.rb +1 -0
- data/lib/jekyll/configuration.rb +13 -1
- data/lib/jekyll/converters/markdown/redcarpet_parser.rb +9 -2
- data/lib/jekyll/convertible.rb +31 -2
- data/lib/jekyll/deprecator.rb +1 -1
- data/lib/jekyll/document.rb +21 -3
- data/lib/jekyll/excerpt.rb +1 -1
- data/lib/jekyll/filters.rb +16 -12
- data/lib/jekyll/frontmatter_defaults.rb +3 -3
- data/lib/jekyll/log_adapter.rb +102 -0
- data/lib/jekyll/post.rb +5 -5
- data/lib/jekyll/renderer.rb +9 -5
- data/lib/jekyll/site.rb +38 -18
- data/lib/jekyll/static_file.rb +1 -0
- data/lib/jekyll/stevenson.rb +54 -98
- data/lib/jekyll/tags/highlight.rb +13 -5
- data/lib/jekyll/url.rb +2 -2
- data/lib/jekyll/utils.rb +15 -7
- data/lib/jekyll/version.rb +1 -1
- data/lib/site_template/_config.yml +2 -0
- data/lib/site_template/_includes/footer.html +8 -8
- data/lib/site_template/_includes/header.html +1 -1
- data/lib/site_template/css/main.css +7 -2
- data/lib/site_template/feed.xml +10 -1
- data/site/_config.yml +1 -0
- data/site/_data/docs.yml +1 -0
- data/site/_includes/anchor_links.html +28 -23
- data/site/_includes/css/font-awesome.css +3 -3
- data/site/_includes/css/style.css +4 -0
- data/site/_includes/news_contents.html +11 -1
- data/site/_includes/top.html +0 -1
- data/site/_layouts/default.html +1 -0
- data/site/_posts/2013-07-25-jekyll-1-0-4-released.markdown +1 -1
- data/site/_posts/2013-07-25-jekyll-1-1-2-released.markdown +1 -1
- data/site/_posts/2014-06-04-jekyll-stickers-1-dollar-stickermule.markdown +19 -0
- data/site/_posts/2014-06-28-jekyll-turns-21-i-mean-2-1-0.markdown +27 -0
- data/site/docs/collections.md +59 -1
- data/site/docs/configuration.md +91 -21
- data/site/docs/continuous-integration.md +177 -0
- data/site/docs/contributing.md +2 -2
- data/site/docs/datafiles.md +47 -3
- data/site/docs/deployment-methods.md +3 -3
- data/site/docs/extras.md +3 -5
- data/site/docs/history.md +86 -0
- data/site/docs/installation.md +3 -1
- data/site/docs/pagination.md +2 -1
- data/site/docs/permalinks.md +4 -4
- data/site/docs/plugins.md +6 -0
- data/site/docs/quickstart.md +0 -6
- data/site/docs/resources.md +1 -1
- data/site/docs/templates.md +1 -1
- data/site/docs/troubleshooting.md +1 -1
- data/site/docs/windows.md +2 -2
- data/site/fonts/FontAwesome.otf +0 -0
- data/site/fonts/fontawesome-webfont.eot +0 -0
- data/site/fonts/fontawesome-webfont.svg +469 -379
- data/site/fonts/fontawesome-webfont.ttf +0 -0
- data/site/fonts/fontawesome-webfont.woff +0 -0
- data/site/img/jekyll-sticker.jpg +0 -0
- data/test/helper.rb +0 -3
- data/test/source/_data/categories/dairy.yaml +6 -0
- data/test/source/_data/members.json +12 -0
- data/test/source/_methods/site/initialize.md +1 -2
- data/test/source/_posts/2009-01-27-no-category.textile +6 -0
- data/test/source/_slides/example-slide-1.html +4 -0
- data/test/source/_slides/example-slide-2.html +7 -0
- data/test/source/_with.dots/all.dots/2.4.0.md +5 -0
- data/test/source/_with.dots/file.with.dots.md +0 -0
- data/test/source/environment.html +5 -0
- data/test/test_cleaner.rb +77 -0
- data/test/test_collections.rb +52 -3
- data/test/test_command.rb +25 -28
- data/test/test_configuration.rb +10 -1
- data/test/test_document.rb +123 -0
- data/test/test_excerpt.rb +11 -0
- data/test/test_filters.rb +28 -2
- data/test/test_generated_site.rb +1 -1
- data/test/test_log_adapter.rb +59 -0
- data/test/test_post.rb +77 -0
- data/test/test_site.rb +51 -0
- data/test/test_tags.rb +11 -114
- data/test/test_utils.rb +2 -2
- metadata +76 -39
- data/lib/jekyll/generators/pagination.rb +0 -217
- data/lib/jekyll/tags/gist.rb +0 -47
- data/test/test_pager.rb +0 -118
Binary file
|
Binary file
|
Binary file
|
data/test/helper.rb
CHANGED
File without changes
|
@@ -0,0 +1,77 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestCleaner < Test::Unit::TestCase
|
4
|
+
context "directory in keep_files" do
|
5
|
+
setup do
|
6
|
+
clear_dest
|
7
|
+
stub(Jekyll).configuration do
|
8
|
+
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir})
|
9
|
+
end
|
10
|
+
|
11
|
+
FileUtils.mkdir_p(dest_dir('to_keep/child_dir'))
|
12
|
+
FileUtils.touch(File.join(dest_dir('to_keep'), 'index.html'))
|
13
|
+
FileUtils.touch(File.join(dest_dir('to_keep/child_dir'), 'index.html'))
|
14
|
+
|
15
|
+
@site = Site.new(Jekyll.configuration)
|
16
|
+
@site.keep_files = ['to_keep/child_dir']
|
17
|
+
|
18
|
+
@cleaner = Site::Cleaner.new(@site)
|
19
|
+
@cleaner.cleanup!
|
20
|
+
end
|
21
|
+
|
22
|
+
teardown do
|
23
|
+
FileUtils.rm_rf(dest_dir('to_keep'))
|
24
|
+
end
|
25
|
+
|
26
|
+
should "keep the parent directory" do
|
27
|
+
assert File.exist?(dest_dir('to_keep'))
|
28
|
+
end
|
29
|
+
|
30
|
+
should "keep the child directory" do
|
31
|
+
assert File.exist?(dest_dir('to_keep/child_dir'))
|
32
|
+
end
|
33
|
+
|
34
|
+
should "keep the file in the directory in keep_files" do
|
35
|
+
assert File.exist?(File.join(dest_dir('to_keep/child_dir'), 'index.html'))
|
36
|
+
end
|
37
|
+
|
38
|
+
should "delete the file in the directory not in keep_files" do
|
39
|
+
assert !File.exist?(File.join(dest_dir('to_keep'), 'index.html'))
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
context "directory containing no files and non-empty directories" do
|
44
|
+
setup do
|
45
|
+
clear_dest
|
46
|
+
stub(Jekyll).configuration do
|
47
|
+
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir})
|
48
|
+
end
|
49
|
+
|
50
|
+
FileUtils.mkdir_p(source_dir('no_files_inside/child_dir'))
|
51
|
+
FileUtils.touch(File.join(source_dir('no_files_inside/child_dir'), 'index.html'))
|
52
|
+
|
53
|
+
@site = Site.new(Jekyll.configuration)
|
54
|
+
@site.process
|
55
|
+
|
56
|
+
@cleaner = Site::Cleaner.new(@site)
|
57
|
+
@cleaner.cleanup!
|
58
|
+
end
|
59
|
+
|
60
|
+
teardown do
|
61
|
+
FileUtils.rm_rf(source_dir('no_files_inside'))
|
62
|
+
FileUtils.rm_rf(dest_dir('no_files_inside'))
|
63
|
+
end
|
64
|
+
|
65
|
+
should "keep the parent directory" do
|
66
|
+
assert File.exist?(dest_dir('no_files_inside'))
|
67
|
+
end
|
68
|
+
|
69
|
+
should "keep the child directory" do
|
70
|
+
assert File.exist?(dest_dir('no_files_inside/child_dir'))
|
71
|
+
end
|
72
|
+
|
73
|
+
should "keep the file" do
|
74
|
+
assert File.exist?(File.join(dest_dir('no_files_inside/child_dir'), 'index.html'))
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
data/test/test_collections.rb
CHANGED
@@ -17,15 +17,15 @@ class TestCollections < Test::Unit::TestCase
|
|
17
17
|
end
|
18
18
|
|
19
19
|
should "sanitize the label name" do
|
20
|
-
assert_equal @collection.label, "etcpassword"
|
20
|
+
assert_equal @collection.label, "....etcpassword"
|
21
21
|
end
|
22
22
|
|
23
23
|
should "have a sanitized relative path name" do
|
24
|
-
assert_equal @collection.relative_directory, "
|
24
|
+
assert_equal @collection.relative_directory, "_....etcpassword"
|
25
25
|
end
|
26
26
|
|
27
27
|
should "have a sanitized full path" do
|
28
|
-
assert_equal @collection.directory, source_dir("
|
28
|
+
assert_equal @collection.directory, source_dir("_....etcpassword")
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -38,6 +38,10 @@ class TestCollections < Test::Unit::TestCase
|
|
38
38
|
assert_equal @collection.label, "methods"
|
39
39
|
end
|
40
40
|
|
41
|
+
should "have default url template" do
|
42
|
+
assert_equal @collection.url_template, "/:collection/:path:output_ext"
|
43
|
+
end
|
44
|
+
|
41
45
|
should "contain no docs when initialized" do
|
42
46
|
assert_empty @collection.docs
|
43
47
|
end
|
@@ -91,6 +95,24 @@ class TestCollections < Test::Unit::TestCase
|
|
91
95
|
end
|
92
96
|
end
|
93
97
|
|
98
|
+
context "a collection with permalink" do
|
99
|
+
setup do
|
100
|
+
@site = fixture_site({
|
101
|
+
"collections" => {
|
102
|
+
"methods" => {
|
103
|
+
"permalink" => "/awesome/:path/"
|
104
|
+
}
|
105
|
+
}
|
106
|
+
})
|
107
|
+
@site.process
|
108
|
+
@collection = @site.collections["methods"]
|
109
|
+
end
|
110
|
+
|
111
|
+
should "have custom url template" do
|
112
|
+
assert_equal @collection.url_template, "/awesome/:path/"
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
94
116
|
context "with a collection" do
|
95
117
|
setup do
|
96
118
|
@site = fixture_site({
|
@@ -172,4 +194,31 @@ class TestCollections < Test::Unit::TestCase
|
|
172
194
|
end
|
173
195
|
end
|
174
196
|
|
197
|
+
context "with dots in the filenames" do
|
198
|
+
setup do
|
199
|
+
@site = fixture_site({
|
200
|
+
"collections" => ["with.dots"],
|
201
|
+
"safe" => true
|
202
|
+
})
|
203
|
+
@site.process
|
204
|
+
@collection = @site.collections["with.dots"]
|
205
|
+
end
|
206
|
+
|
207
|
+
should "exist" do
|
208
|
+
assert_not_nil @collection
|
209
|
+
end
|
210
|
+
|
211
|
+
should "contain one document" do
|
212
|
+
assert_equal 2, @collection.docs.size
|
213
|
+
end
|
214
|
+
|
215
|
+
should "allow dots in the filename" do
|
216
|
+
assert_equal "_with.dots", @collection.relative_directory
|
217
|
+
end
|
218
|
+
|
219
|
+
should "read document in subfolders with dots" do
|
220
|
+
assert @collection.docs.any? { |d| d.path.include?("all.dots") }
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
175
224
|
end
|
data/test/test_command.rb
CHANGED
@@ -1,38 +1,35 @@
|
|
1
1
|
require 'helper'
|
2
2
|
|
3
3
|
class TestCommand < Test::Unit::TestCase
|
4
|
-
context "when calling .
|
5
|
-
context "when
|
6
|
-
setup
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
assert !@globs.include?(@dest)
|
15
|
-
end
|
16
|
-
teardown do
|
17
|
-
clear_dest
|
4
|
+
context "when calling .ignore_paths" do
|
5
|
+
context "when source is absolute" do
|
6
|
+
setup { @source = source_dir }
|
7
|
+
should "return an array with regex for destination" do
|
8
|
+
absolute = source_dir('dest')
|
9
|
+
relative = Pathname.new(source_dir('dest')).relative_path_from(Pathname.new('.').expand_path).to_s
|
10
|
+
[absolute, relative].each do |dest|
|
11
|
+
config = build_configs("source" => @source, "destination" => dest)
|
12
|
+
assert Command.ignore_paths(config).include?(/dest/), "failed with destination: #{dest}"
|
13
|
+
end
|
18
14
|
end
|
19
15
|
end
|
20
|
-
context "when
|
21
|
-
setup
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
assert @globs.is_a?(Array)
|
29
|
-
assert !@globs.include?(@dest)
|
30
|
-
@globs.each do |glob|
|
31
|
-
assert !glob.include?(File.basename(@dest))
|
16
|
+
context "when source is relative" do
|
17
|
+
setup { @source = Pathname.new(source_dir).relative_path_from(Pathname.new('.').expand_path).to_s }
|
18
|
+
should "return an array with regex for destination" do
|
19
|
+
absolute = source_dir('dest')
|
20
|
+
relative = Pathname.new(source_dir('dest')).relative_path_from(Pathname.new('.').expand_path).to_s
|
21
|
+
[absolute, relative].each do |dest|
|
22
|
+
config = build_configs("source" => @source, "destination" => dest)
|
23
|
+
assert Command.ignore_paths(config).include?(/dest/), "failed with destination: #{dest}"
|
32
24
|
end
|
33
25
|
end
|
34
|
-
|
35
|
-
|
26
|
+
end
|
27
|
+
context "multiple config files" do
|
28
|
+
should "return an array with regex for config files" do
|
29
|
+
config = build_configs("config"=> ["_config.yaml", "_config2.yml"])
|
30
|
+
ignore_paths = Command.ignore_paths(config)
|
31
|
+
assert ignore_paths.include?(/_config\.yaml/), 'did not include _config.yaml'
|
32
|
+
assert ignore_paths.include?(/_config2\.yml/), 'did not include _config2.yml'
|
36
33
|
end
|
37
34
|
end
|
38
35
|
end
|
data/test/test_configuration.rb
CHANGED
@@ -39,7 +39,16 @@ class TestConfiguration < Test::Unit::TestCase
|
|
39
39
|
assert @config.config_files(@multiple_files).is_a?(Array)
|
40
40
|
end
|
41
41
|
should "return the default config path if no config files are specified" do
|
42
|
-
assert_equal [
|
42
|
+
assert_equal [source_dir("_config.yml")], @config.config_files(@no_override)
|
43
|
+
end
|
44
|
+
should "return .yaml if it exists but .yml does not" do
|
45
|
+
mock(File).exists?(source_dir("_config.yml")) { false }
|
46
|
+
mock(File).exists?(source_dir("_config.yaml")) { true }
|
47
|
+
assert_equal [source_dir("_config.yaml")], @config.config_files(@no_override)
|
48
|
+
end
|
49
|
+
should "return .yml if both .yml and .yaml exist" do
|
50
|
+
mock(File).exists?(source_dir("_config.yml")) { true }
|
51
|
+
assert_equal [source_dir("_config.yml")], @config.config_files(@no_override)
|
43
52
|
end
|
44
53
|
should "return the config if given one config file" do
|
45
54
|
assert_equal %w[config.yml], @config.config_files(@one_config_file)
|
data/test/test_document.rb
CHANGED
@@ -40,6 +40,129 @@ class TestDocument < Test::Unit::TestCase
|
|
40
40
|
}, @document.data)
|
41
41
|
end
|
42
42
|
|
43
|
+
should "output the collection name in the #to_liquid method" do
|
44
|
+
assert_equal @document.to_liquid['collection'], "methods"
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
context "a document as part of a collection with frontmatter defaults" do
|
50
|
+
setup do
|
51
|
+
@site = Site.new(Jekyll.configuration({
|
52
|
+
"collections" => ["slides"],
|
53
|
+
"source" => source_dir,
|
54
|
+
"destination" => dest_dir,
|
55
|
+
"defaults" => [{
|
56
|
+
"scope"=> {"path"=>"", "type"=>"slides"},
|
57
|
+
"values"=> {
|
58
|
+
"nested"=> {
|
59
|
+
"key"=>"myval",
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}]
|
63
|
+
}))
|
64
|
+
@site.process
|
65
|
+
@document = @site.collections["slides"].docs.first
|
66
|
+
end
|
67
|
+
|
68
|
+
should "know the frontmatter defaults" do
|
69
|
+
assert_equal({
|
70
|
+
"title"=>"Example slide",
|
71
|
+
"layout"=>"slide",
|
72
|
+
"nested"=> {
|
73
|
+
"key"=>"myval"
|
74
|
+
}
|
75
|
+
}, @document.data)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
context "a document as part of a collection with overriden default values" do
|
80
|
+
setup do
|
81
|
+
@site = Site.new(Jekyll.configuration({
|
82
|
+
"collections" => ["slides"],
|
83
|
+
"source" => source_dir,
|
84
|
+
"destination" => dest_dir,
|
85
|
+
"defaults" => [{
|
86
|
+
"scope"=> {"path"=>"", "type"=>"slides"},
|
87
|
+
"values"=> {
|
88
|
+
"nested"=> {
|
89
|
+
"test1"=>"default1",
|
90
|
+
"test2"=>"default1"
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}]
|
94
|
+
}))
|
95
|
+
@site.process
|
96
|
+
@document = @site.collections["slides"].docs[1]
|
97
|
+
end
|
98
|
+
|
99
|
+
should "override default values in the document frontmatter" do
|
100
|
+
assert_equal({
|
101
|
+
"title"=>"Override title",
|
102
|
+
"layout"=>"slide",
|
103
|
+
"nested"=> {
|
104
|
+
"test1"=>"override1",
|
105
|
+
"test2"=>"override2"
|
106
|
+
}
|
107
|
+
}, @document.data)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
context "a document as part of a collection with valid path" do
|
112
|
+
setup do
|
113
|
+
@site = Site.new(Jekyll.configuration({
|
114
|
+
"collections" => ["slides"],
|
115
|
+
"source" => source_dir,
|
116
|
+
"destination" => dest_dir,
|
117
|
+
"defaults" => [{
|
118
|
+
"scope"=> {"path"=>"slides", "type"=>"slides"},
|
119
|
+
"values"=> {
|
120
|
+
"nested"=> {
|
121
|
+
"key"=>"value123",
|
122
|
+
}
|
123
|
+
}
|
124
|
+
}]
|
125
|
+
}))
|
126
|
+
@site.process
|
127
|
+
@document = @site.collections["slides"].docs.first
|
128
|
+
end
|
129
|
+
|
130
|
+
should "know the frontmatter defaults" do
|
131
|
+
assert_equal({
|
132
|
+
"title"=>"Example slide",
|
133
|
+
"layout"=>"slide",
|
134
|
+
"nested"=> {
|
135
|
+
"key"=>"value123"
|
136
|
+
}
|
137
|
+
}, @document.data)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
context "a document as part of a collection with invalid path" do
|
142
|
+
setup do
|
143
|
+
@site = Site.new(Jekyll.configuration({
|
144
|
+
"collections" => ["slides"],
|
145
|
+
"source" => source_dir,
|
146
|
+
"destination" => dest_dir,
|
147
|
+
"defaults" => [{
|
148
|
+
"scope"=> {"path"=>"somepath", "type"=>"slides"},
|
149
|
+
"values"=> {
|
150
|
+
"nested"=> {
|
151
|
+
"key"=>"myval",
|
152
|
+
}
|
153
|
+
}
|
154
|
+
}]
|
155
|
+
}))
|
156
|
+
@site.process
|
157
|
+
@document = @site.collections["slides"].docs.first
|
158
|
+
end
|
159
|
+
|
160
|
+
should "not know the specified frontmatter defaults" do
|
161
|
+
assert_equal({
|
162
|
+
"title"=>"Example slide",
|
163
|
+
"layout"=>"slide"
|
164
|
+
}, @document.data)
|
165
|
+
end
|
43
166
|
end
|
44
167
|
|
45
168
|
context " a document part of a rendered collection" do
|