jekyll 2.0.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
data/lib/jekyll/tags/gist.rb
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
# Gist Liquid Tag
|
2
|
-
#
|
3
|
-
# Example:
|
4
|
-
# {% gist username/1234567 %}
|
5
|
-
# {% gist username/1234567 file.rb %}
|
6
|
-
|
7
|
-
module Jekyll
|
8
|
-
class GistTag < Liquid::Tag
|
9
|
-
|
10
|
-
def render(context)
|
11
|
-
if tag_contents = determine_arguments(@markup.strip)
|
12
|
-
gist_id, filename = tag_contents[0], tag_contents[1]
|
13
|
-
gist_script_tag(gist_id, filename)
|
14
|
-
else
|
15
|
-
raise ArgumentError.new <<-eos
|
16
|
-
Syntax error in tag 'gist' while parsing the following markup:
|
17
|
-
|
18
|
-
#{@markup}
|
19
|
-
|
20
|
-
Valid syntax:
|
21
|
-
for all gists: {% gist user/1234567 %}
|
22
|
-
eos
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
private
|
27
|
-
|
28
|
-
def determine_arguments(input)
|
29
|
-
matched = if input.include?("/")
|
30
|
-
input.match(/\A([a-zA-Z0-9\/\-_]+) ?(\S*)\Z/)
|
31
|
-
else
|
32
|
-
input.match(/\A(\d+) ?(\S*)\Z/)
|
33
|
-
end
|
34
|
-
[matched[1].strip, matched[2].strip] if matched && matched.length >= 3
|
35
|
-
end
|
36
|
-
|
37
|
-
def gist_script_tag(gist_id, filename = nil)
|
38
|
-
if filename.empty?
|
39
|
-
"<script src=\"https://gist.github.com/#{gist_id}.js\"> </script>"
|
40
|
-
else
|
41
|
-
"<script src=\"https://gist.github.com/#{gist_id}.js?file=#{filename}\"> </script>"
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
Liquid::Template.register_tag('gist', Jekyll::GistTag)
|
data/test/test_pager.rb
DELETED
@@ -1,118 +0,0 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
|
-
class TestPager < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def build_site(config = {})
|
6
|
-
base = build_configs({
|
7
|
-
'source' => source_dir,
|
8
|
-
'destination' => dest_dir,
|
9
|
-
'paginate' => 1
|
10
|
-
})
|
11
|
-
site = Jekyll::Site.new(site_configuration(
|
12
|
-
{"paginate" => 1}.merge(config)
|
13
|
-
))
|
14
|
-
site.process
|
15
|
-
site
|
16
|
-
end
|
17
|
-
|
18
|
-
should "calculate number of pages" do
|
19
|
-
assert_equal(0, Pager.calculate_pages([], '2'))
|
20
|
-
assert_equal(1, Pager.calculate_pages([1], '2'))
|
21
|
-
assert_equal(1, Pager.calculate_pages([1,2], '2'))
|
22
|
-
assert_equal(2, Pager.calculate_pages([1,2,3], '2'))
|
23
|
-
assert_equal(2, Pager.calculate_pages([1,2,3,4], '2'))
|
24
|
-
assert_equal(3, Pager.calculate_pages([1,2,3,4,5], '2'))
|
25
|
-
end
|
26
|
-
|
27
|
-
should "determine the pagination path" do
|
28
|
-
assert_equal("/index.html", Pager.paginate_path(build_site, 1))
|
29
|
-
assert_equal("/page2", Pager.paginate_path(build_site, 2))
|
30
|
-
assert_equal("/index.html", Pager.paginate_path(build_site({'paginate_path' => '/blog/page-:num'}), 1))
|
31
|
-
assert_equal("/blog/page-2", Pager.paginate_path(build_site({'paginate_path' => '/blog/page-:num'}), 2))
|
32
|
-
assert_equal("/index.html", Pager.paginate_path(build_site({'paginate_path' => '/blog/page/:num'}), 1))
|
33
|
-
assert_equal("/blog/page/2", Pager.paginate_path(build_site({'paginate_path' => '/blog/page/:num'}), 2))
|
34
|
-
assert_equal("/contacts/index.html", Pager.paginate_path(build_site({'paginate_path' => '/contacts/page:num'}), 1))
|
35
|
-
assert_equal("/contacts/page2", Pager.paginate_path(build_site({'paginate_path' => '/contacts/page:num'}), 2))
|
36
|
-
assert_equal("/contacts/index.html", Pager.paginate_path(build_site({'paginate_path' => '/contacts/page/:num'}), 1))
|
37
|
-
assert_equal("/contacts/page/2", Pager.paginate_path(build_site({'paginate_path' => '/contacts/page/:num'}), 2))
|
38
|
-
end
|
39
|
-
|
40
|
-
context "pagination disabled" do
|
41
|
-
should "report that pagination is disabled" do
|
42
|
-
assert !Pager.pagination_enabled?(build_site('paginate' => nil))
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
context "pagination enabled for 2" do
|
47
|
-
setup do
|
48
|
-
@site = build_site('paginate' => 2)
|
49
|
-
@posts = @site.posts
|
50
|
-
end
|
51
|
-
|
52
|
-
should "report that pagination is enabled" do
|
53
|
-
assert Pager.pagination_enabled?(@site)
|
54
|
-
end
|
55
|
-
|
56
|
-
context "with 4 posts" do
|
57
|
-
setup do
|
58
|
-
@posts = @site.posts[1..4] # limit to 4
|
59
|
-
end
|
60
|
-
|
61
|
-
should "create first pager" do
|
62
|
-
pager = Pager.new(@site, 1, @posts)
|
63
|
-
assert_equal(2, pager.posts.size)
|
64
|
-
assert_equal(2, pager.total_pages)
|
65
|
-
assert_nil(pager.previous_page)
|
66
|
-
assert_equal(2, pager.next_page)
|
67
|
-
end
|
68
|
-
|
69
|
-
should "create second pager" do
|
70
|
-
pager = Pager.new(@site, 2, @posts)
|
71
|
-
assert_equal(2, pager.posts.size)
|
72
|
-
assert_equal(2, pager.total_pages)
|
73
|
-
assert_equal(1, pager.previous_page)
|
74
|
-
assert_nil(pager.next_page)
|
75
|
-
end
|
76
|
-
|
77
|
-
should "not create third pager" do
|
78
|
-
assert_raise(RuntimeError) { Pager.new(@site, 3, @posts) }
|
79
|
-
end
|
80
|
-
|
81
|
-
end
|
82
|
-
|
83
|
-
context "with 5 posts" do
|
84
|
-
setup do
|
85
|
-
@posts = @site.posts[1..5] # limit to 5
|
86
|
-
end
|
87
|
-
|
88
|
-
should "create first pager" do
|
89
|
-
pager = Pager.new(@site, 1, @posts)
|
90
|
-
assert_equal(2, pager.posts.size)
|
91
|
-
assert_equal(3, pager.total_pages)
|
92
|
-
assert_nil(pager.previous_page)
|
93
|
-
assert_equal(2, pager.next_page)
|
94
|
-
end
|
95
|
-
|
96
|
-
should "create second pager" do
|
97
|
-
pager = Pager.new(@site, 2, @posts)
|
98
|
-
assert_equal(2, pager.posts.size)
|
99
|
-
assert_equal(3, pager.total_pages)
|
100
|
-
assert_equal(1, pager.previous_page)
|
101
|
-
assert_equal(3, pager.next_page)
|
102
|
-
end
|
103
|
-
|
104
|
-
should "create third pager" do
|
105
|
-
pager = Pager.new(@site, 3, @posts)
|
106
|
-
assert_equal(1, pager.posts.size)
|
107
|
-
assert_equal(3, pager.total_pages)
|
108
|
-
assert_equal(2, pager.previous_page)
|
109
|
-
assert_nil(pager.next_page)
|
110
|
-
end
|
111
|
-
|
112
|
-
should "not create fourth pager" do
|
113
|
-
assert_raise(RuntimeError) { Pager.new(@site, 4, @posts) }
|
114
|
-
end
|
115
|
-
|
116
|
-
end
|
117
|
-
end
|
118
|
-
end
|