jekyll 2.2.0 → 2.3.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/README.markdown +1 -1
- data/lib/jekyll.rb +0 -1
- data/lib/jekyll/collection.rb +18 -3
- data/lib/jekyll/command.rb +0 -25
- data/lib/jekyll/commands/build.rb +7 -2
- data/lib/jekyll/commands/help.rb +33 -0
- data/lib/jekyll/configuration.rb +36 -28
- data/lib/jekyll/converters/markdown/kramdown_parser.rb +1 -1
- data/lib/jekyll/convertible.rb +43 -20
- data/lib/jekyll/deprecator.rb +15 -8
- data/lib/jekyll/document.rb +21 -4
- data/lib/jekyll/filters.rb +27 -1
- data/lib/jekyll/frontmatter_defaults.rb +46 -12
- data/lib/jekyll/plugin.rb +10 -1
- data/lib/jekyll/post.rb +6 -13
- data/lib/jekyll/related_posts.rb +2 -2
- data/lib/jekyll/renderer.rb +7 -2
- data/lib/jekyll/site.rb +5 -7
- data/lib/jekyll/static_file.rb +24 -4
- data/lib/jekyll/tags/include.rb +3 -1
- data/lib/jekyll/tags/post_url.rb +2 -2
- data/lib/jekyll/utils.rb +88 -69
- data/lib/jekyll/version.rb +1 -1
- data/lib/site_template/_config.yml +6 -4
- data/lib/site_template/_includes/footer.html +43 -49
- data/lib/site_template/_includes/head.html +3 -4
- data/lib/site_template/_includes/header.html +9 -10
- data/lib/site_template/_layouts/default.html +6 -5
- data/lib/site_template/_layouts/page.html +3 -3
- data/lib/site_template/_layouts/post.html +4 -4
- data/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +6 -5
- data/lib/site_template/_sass/_base.scss +203 -0
- data/lib/site_template/_sass/_layout.scss +236 -0
- data/lib/site_template/_sass/_syntax-highlighting.scss +67 -0
- data/lib/site_template/css/main.scss +49 -0
- data/lib/site_template/feed.xml +1 -1
- data/lib/site_template/index.html +7 -4
- metadata +24 -431
- data/.gitignore +0 -15
- data/.travis.yml +0 -27
- data/CONTRIBUTING.markdown +0 -91
- data/Gemfile +0 -2
- data/History.markdown +0 -1310
- data/Rakefile +0 -268
- data/cucumber.yml +0 -3
- data/docs/jp/CONTRIBUTING.jp.markdown +0 -93
- data/docs/jp/README.jp.markdown +0 -68
- data/features/collections.feature +0 -145
- data/features/create_sites.feature +0 -158
- data/features/data.feature +0 -105
- data/features/drafts.feature +0 -46
- data/features/embed_filters.feature +0 -107
- data/features/frontmatter_defaults.feature +0 -136
- data/features/include_tag.feature +0 -68
- data/features/markdown.feature +0 -67
- data/features/pagination.feature +0 -82
- data/features/permalinks.feature +0 -85
- data/features/post_data.feature +0 -261
- data/features/post_excerpts.feature +0 -50
- data/features/rendering.feature +0 -34
- data/features/site_configuration.feature +0 -283
- data/features/site_data.feature +0 -107
- data/features/step_definitions/jekyll_steps.rb +0 -201
- data/features/support/env.rb +0 -65
- data/jekyll.gemspec +0 -66
- data/lib/site_template/css/main.css +0 -410
- data/script/bootstrap +0 -4
- data/script/branding +0 -11
- data/script/cibuild +0 -7
- data/script/console +0 -38
- data/script/proof +0 -22
- data/script/rebund +0 -140
- data/script/test +0 -17
- data/site/.gitignore +0 -4
- data/site/CNAME +0 -1
- data/site/README +0 -1
- data/site/_config.yml +0 -9
- data/site/_data/docs.yml +0 -46
- data/site/_includes/analytics.html +0 -30
- data/site/_includes/anchor_links.html +0 -32
- data/site/_includes/css/font-awesome.css +0 -44
- data/site/_includes/css/gridism.css +0 -110
- data/site/_includes/css/normalize.css +0 -1
- data/site/_includes/css/pygments.css +0 -72
- data/site/_includes/css/style.css +0 -1045
- data/site/_includes/docs_contents.html +0 -8
- data/site/_includes/docs_contents_mobile.html +0 -10
- data/site/_includes/docs_option.html +0 -11
- data/site/_includes/docs_ul.html +0 -20
- data/site/_includes/footer.html +0 -15
- data/site/_includes/header.html +0 -18
- data/site/_includes/news_contents.html +0 -33
- data/site/_includes/news_contents_mobile.html +0 -11
- data/site/_includes/news_item.html +0 -24
- data/site/_includes/primary-nav-items.html +0 -17
- data/site/_includes/section_nav.html +0 -22
- data/site/_includes/top.html +0 -17
- data/site/_layouts/default.html +0 -13
- data/site/_layouts/docs.html +0 -23
- data/site/_layouts/news.html +0 -19
- data/site/_layouts/news_item.html +0 -27
- data/site/_posts/2013-05-06-jekyll-1-0-0-released.markdown +0 -23
- data/site/_posts/2013-05-08-jekyll-1-0-1-released.markdown +0 -27
- data/site/_posts/2013-05-12-jekyll-1-0-2-released.markdown +0 -28
- data/site/_posts/2013-06-07-jekyll-1-0-3-released.markdown +0 -25
- data/site/_posts/2013-07-14-jekyll-1-1-0-released.markdown +0 -27
- data/site/_posts/2013-07-24-jekyll-1-1-1-released.markdown +0 -31
- data/site/_posts/2013-07-25-jekyll-1-0-4-released.markdown +0 -20
- data/site/_posts/2013-07-25-jekyll-1-1-2-released.markdown +0 -20
- data/site/_posts/2013-09-06-jekyll-1-2-0-released.markdown +0 -23
- data/site/_posts/2013-09-14-jekyll-1-2-1-released.markdown +0 -19
- data/site/_posts/2013-10-28-jekyll-1-3-0-rc1-released.markdown +0 -19
- data/site/_posts/2013-11-04-jekyll-1-3-0-released.markdown +0 -43
- data/site/_posts/2013-11-26-jekyll-1-3-1-released.markdown +0 -21
- data/site/_posts/2013-12-07-jekyll-1-4-0-released.markdown +0 -30
- data/site/_posts/2013-12-09-jekyll-1-4-1-released.markdown +0 -20
- data/site/_posts/2013-12-16-jekyll-1-4-2-released.markdown +0 -18
- data/site/_posts/2014-01-13-jekyll-1-4-3-released.markdown +0 -26
- 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/_posts/2014-05-06-jekyll-turns-2-0-0.markdown +0 -31
- data/site/_posts/2014-05-08-jekyll-2-0-3-released.markdown +0 -18
- data/site/_posts/2014-06-04-jekyll-stickers-1-dollar-stickermule.markdown +0 -19
- data/site/_posts/2014-06-28-jekyll-turns-21-i-mean-2-1-0.markdown +0 -31
- data/site/_posts/2014-07-01-jekyll-2-1-1-released.markdown +0 -30
- data/site/_posts/2014-07-29-jekyll-2-2-0-released.markdown +0 -19
- data/site/css/screen.css +0 -31
- data/site/docs/assets.md +0 -66
- data/site/docs/collections.md +0 -259
- data/site/docs/configuration.md +0 -536
- data/site/docs/continuous-integration.md +0 -177
- data/site/docs/contributing.md +0 -133
- data/site/docs/datafiles.md +0 -108
- data/site/docs/deployment-methods.md +0 -127
- data/site/docs/drafts.md +0 -21
- data/site/docs/extras.md +0 -18
- data/site/docs/frontmatter.md +0 -191
- data/site/docs/github-pages.md +0 -91
- data/site/docs/history.md +0 -1514
- data/site/docs/index.md +0 -58
- data/site/docs/installation.md +0 -106
- data/site/docs/migrations.md +0 -11
- data/site/docs/pages.md +0 -86
- data/site/docs/pagination.md +0 -212
- data/site/docs/permalinks.md +0 -188
- data/site/docs/plugins.md +0 -561
- data/site/docs/posts.md +0 -211
- data/site/docs/quickstart.md +0 -26
- data/site/docs/resources.md +0 -43
- data/site/docs/sites.md +0 -29
- data/site/docs/structure.md +0 -190
- data/site/docs/templates.md +0 -376
- data/site/docs/troubleshooting.md +0 -147
- data/site/docs/upgrading.md +0 -146
- data/site/docs/usage.md +0 -74
- data/site/docs/variables.md +0 -382
- data/site/docs/windows.md +0 -44
- data/site/favicon.ico +0 -0
- data/site/feed.xml +0 -48
- data/site/fonts/FontAwesome.otf +0 -0
- data/site/fonts/fontawesome-webfont.eot +0 -0
- data/site/fonts/fontawesome-webfont.svg +0 -504
- data/site/fonts/fontawesome-webfont.ttf +0 -0
- data/site/fonts/fontawesome-webfont.woff +0 -0
- data/site/freenode.txt +0 -1
- data/site/img/article-footer.png +0 -0
- data/site/img/footer-arrow.png +0 -0
- data/site/img/footer-logo.png +0 -0
- data/site/img/jekyll-sticker.jpg +0 -0
- data/site/img/logo-2x.png +0 -0
- data/site/img/logo-rss.png +0 -0
- data/site/img/octojekyll.png +0 -0
- data/site/index.html +0 -90
- data/site/js/html5shiv.min.js +0 -4
- data/site/js/respond.min.js +0 -5
- data/site/news/index.html +0 -10
- data/site/news/releases/index.html +0 -10
- data/test/fixtures/broken_front_matter1.erb +0 -5
- data/test/fixtures/broken_front_matter2.erb +0 -4
- data/test/fixtures/broken_front_matter3.erb +0 -7
- data/test/fixtures/exploit_front_matter.erb +0 -4
- data/test/fixtures/front_matter.erb +0 -4
- data/test/helper.rb +0 -80
- data/test/source/+/%# +.md +0 -6
- data/test/source/+/foo.md +0 -7
- data/test/source/.htaccess +0 -8
- data/test/source/_config.dev.toml +0 -2
- data/test/source/_data/categories/dairy.yaml +0 -6
- data/test/source/_data/languages.yml +0 -2
- data/test/source/_data/members.json +0 -12
- data/test/source/_data/members.yaml +0 -7
- data/test/source/_data/products.yml +0 -4
- data/test/source/_drafts/draft-properties.text +0 -11
- data/test/source/_includes/include.html +0 -1
- data/test/source/_includes/params.html +0 -7
- data/test/source/_includes/sig.markdown +0 -3
- data/test/source/_layouts/default.html +0 -27
- data/test/source/_layouts/post/simple.html +0 -1
- data/test/source/_layouts/simple.html +0 -1
- data/test/source/_methods/_do_not_read_me.md +0 -5
- data/test/source/_methods/configuration.md +0 -8
- data/test/source/_methods/sanitized_path.md +0 -5
- data/test/source/_methods/site/_dont_include_me_either.md +0 -5
- data/test/source/_methods/site/generate.md +0 -6
- data/test/source/_methods/site/initialize.md +0 -4
- data/test/source/_methods/um_hi.md +0 -6
- data/test/source/_plugins/dummy.rb +0 -8
- data/test/source/_posts/2008-02-02-not-published.textile +0 -8
- data/test/source/_posts/2008-02-02-published.textile +0 -8
- data/test/source/_posts/2008-10-18-foo-bar.textile +0 -8
- data/test/source/_posts/2008-11-21-complex.textile +0 -8
- data/test/source/_posts/2008-12-03-permalinked-post.textile +0 -9
- data/test/source/_posts/2008-12-13-include.markdown +0 -8
- data/test/source/_posts/2009-01-27-array-categories.textile +0 -10
- data/test/source/_posts/2009-01-27-categories.textile +0 -7
- data/test/source/_posts/2009-01-27-category.textile +0 -7
- data/test/source/_posts/2009-01-27-empty-categories.textile +0 -7
- data/test/source/_posts/2009-01-27-empty-category.textile +0 -7
- data/test/source/_posts/2009-01-27-no-category.textile +0 -6
- data/test/source/_posts/2009-03-12-hash-#1.markdown +0 -6
- data/test/source/_posts/2009-05-18-empty-tag.textile +0 -6
- data/test/source/_posts/2009-05-18-empty-tags.textile +0 -6
- data/test/source/_posts/2009-05-18-tag.textile +0 -6
- data/test/source/_posts/2009-05-18-tags.textile +0 -9
- data/test/source/_posts/2009-06-22-empty-yaml.textile +0 -3
- data/test/source/_posts/2009-06-22-no-yaml.textile +0 -1
- data/test/source/_posts/2010-01-08-triple-dash.markdown +0 -5
- data/test/source/_posts/2010-01-09-date-override.textile +0 -7
- data/test/source/_posts/2010-01-09-time-override.textile +0 -7
- data/test/source/_posts/2010-01-09-timezone-override.textile +0 -7
- data/test/source/_posts/2010-01-16-override-data.textile +0 -4
- data/test/source/_posts/2011-04-12-md-extension.md +0 -7
- data/test/source/_posts/2011-04-12-text-extension.text +0 -0
- data/test/source/_posts/2013-01-02-post-excerpt.markdown +0 -14
- data/test/source/_posts/2013-01-12-nil-layout.textile +0 -6
- data/test/source/_posts/2013-01-12-no-layout.textile +0 -5
- data/test/source/_posts/2013-03-19-not-a-post.markdown/.gitkeep +0 -0
- data/test/source/_posts/2013-04-11-custom-excerpt.markdown +0 -10
- data/test/source/_posts/2013-05-10-number-category.textile +0 -7
- data/test/source/_posts/2013-07-22-post-excerpt-with-layout.markdown +0 -23
- data/test/source/_posts/2013-08-01-mkdn-extension.mkdn +0 -0
- data/test/source/_posts/2013-12-17-include-variable-filters.markdown +0 -21
- data/test/source/_posts/2013-12-20-properties.text +0 -11
- data/test/source/_posts/2014-01-06-permalink-traversal.md +0 -5
- data/test/source/_posts/2014-03-03-yaml-with-dots.md +0 -5
- data/test/source/_posts/2014-03-22-escape-+ %20[].markdown +0 -6
- data/test/source/_posts/es/2008-11-21-nested.textile +0 -8
- data/test/source/_sass/_grid.scss +0 -1
- data/test/source/_slides/example-slide-1.html +0 -4
- data/test/source/_slides/example-slide-2.html +0 -7
- data/test/source/_slides/example-slide-3.html +0 -5
- data/test/source/_with.dots/all.dots/2.4.0.md +0 -5
- data/test/source/_with.dots/file.with.dots.md +0 -0
- data/test/source/about.html +0 -6
- data/test/source/category/_posts/2008-9-23-categories.textile +0 -6
- data/test/source/contacts.html +0 -5
- data/test/source/contacts/bar.html +0 -5
- data/test/source/contacts/index.html +0 -5
- data/test/source/css/main.scss +0 -4
- data/test/source/css/screen.css +0 -76
- data/test/source/deal.with.dots.html +0 -7
- data/test/source/environment.html +0 -5
- data/test/source/exploit.md +0 -5
- data/test/source/foo/_posts/bar/2008-12-12-topical-post.textile +0 -8
- data/test/source/index.html +0 -22
- data/test/source/js/coffeescript.coffee +0 -10
- data/test/source/pgp.key +0 -2
- data/test/source/products.yml +0 -4
- data/test/source/properties.html +0 -8
- data/test/source/sitemap.xml +0 -32
- data/test/source/static_files.html +0 -4
- data/test/source/symlink-test/symlinked-file +0 -22
- data/test/source/unpublished.html +0 -7
- data/test/source/win/_posts/2009-05-24-yaml-linebreak.markdown +0 -7
- data/test/source/z_category/_posts/2008-9-23-categories.textile +0 -6
- data/test/suite.rb +0 -11
- data/test/test_cleaner.rb +0 -77
- data/test/test_coffeescript.rb +0 -49
- data/test/test_collections.rb +0 -224
- data/test/test_command.rb +0 -53
- data/test/test_configuration.rb +0 -201
- data/test/test_convertible.rb +0 -49
- data/test/test_document.rb +0 -193
- data/test/test_draft.rb +0 -56
- data/test/test_entry_filter.rb +0 -124
- data/test/test_excerpt.rb +0 -131
- data/test/test_filters.rb +0 -207
- data/test/test_generated_site.rb +0 -97
- data/test/test_kramdown.rb +0 -62
- data/test/test_layout_reader.rb +0 -34
- data/test/test_liquid_extensions.rb +0 -31
- data/test/test_log_adapter.rb +0 -59
- data/test/test_new_command.rb +0 -104
- data/test/test_page.rb +0 -254
- data/test/test_path_sanitization.rb +0 -18
- data/test/test_post.rb +0 -741
- data/test/test_rdiscount.rb +0 -22
- data/test/test_redcarpet.rb +0 -77
- data/test/test_redcloth.rb +0 -86
- data/test/test_related_posts.rb +0 -47
- data/test/test_sass.rb +0 -26
- data/test/test_site.rb +0 -452
- data/test/test_tags.rb +0 -509
- data/test/test_url.rb +0 -28
- data/test/test_utils.rb +0 -67
data/test/test_rdiscount.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
|
-
class TestRdiscount < Test::Unit::TestCase
|
4
|
-
|
5
|
-
context "rdiscount" do
|
6
|
-
setup do
|
7
|
-
config = {
|
8
|
-
'markdown' => 'rdiscount',
|
9
|
-
'rdiscount' => { 'extensions' => ['smart', 'generate_toc'], 'toc_token' => '{:toc}' }
|
10
|
-
}
|
11
|
-
@markdown = Converters::Markdown.new config
|
12
|
-
end
|
13
|
-
|
14
|
-
should "pass rdiscount extensions" do
|
15
|
-
assert_equal "<p>“smart”</p>", @markdown.convert('"smart"').strip
|
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
|
21
|
-
end
|
22
|
-
end
|
data/test/test_redcarpet.rb
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
|
-
class TestRedcarpet < Test::Unit::TestCase
|
4
|
-
context "redcarpet" do
|
5
|
-
setup do
|
6
|
-
@config = {
|
7
|
-
'redcarpet' => { 'extensions' => ['smart', 'strikethrough', 'filter_html'] },
|
8
|
-
'markdown' => 'redcarpet'
|
9
|
-
}
|
10
|
-
@markdown = Converters::Markdown.new @config
|
11
|
-
end
|
12
|
-
|
13
|
-
should "pass redcarpet options" do
|
14
|
-
assert_equal "<h1>Some Header</h1>", @markdown.convert('# Some Header #').strip
|
15
|
-
end
|
16
|
-
|
17
|
-
should "pass redcarpet SmartyPants options" do
|
18
|
-
assert_equal "<p>“smart”</p>", @markdown.convert('"smart"').strip
|
19
|
-
end
|
20
|
-
|
21
|
-
should "pass redcarpet extensions" do
|
22
|
-
assert_equal "<p><del>deleted</del></p>", @markdown.convert('~~deleted~~').strip
|
23
|
-
end
|
24
|
-
|
25
|
-
should "pass redcarpet render options" do
|
26
|
-
assert_equal "<p><strong>bad code not here</strong>: i am bad</p>", @markdown.convert('**bad code not here**: <script>i am bad</script>').strip
|
27
|
-
end
|
28
|
-
|
29
|
-
context "with pygments enabled" do
|
30
|
-
setup do
|
31
|
-
@markdown = Converters::Markdown.new @config.merge({ 'highlighter' => 'pygments' })
|
32
|
-
end
|
33
|
-
|
34
|
-
should "render fenced code blocks with syntax highlighting" do
|
35
|
-
assert_equal "<div class=\"highlight\"><pre><code class=\"language-ruby\" data-lang=\"ruby\"><span class=\"nb\">puts</span> <span class=\"s2\">"Hello world"</span>\n</code></pre></div>", @markdown.convert(
|
36
|
-
<<-EOS
|
37
|
-
```ruby
|
38
|
-
puts "Hello world"
|
39
|
-
```
|
40
|
-
EOS
|
41
|
-
).strip
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
context "with rouge enabled" do
|
46
|
-
setup do
|
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=\"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 })
|
64
|
-
end
|
65
|
-
|
66
|
-
should "render fenced code blocks without syntax highlighting" do
|
67
|
-
assert_equal "<div class=\"highlight\"><pre><code class=\"language-ruby\" data-lang=\"ruby\">puts "Hello world"\n</code></pre></div>", @markdown.convert(
|
68
|
-
<<-EOS
|
69
|
-
```ruby
|
70
|
-
puts "Hello world"
|
71
|
-
```
|
72
|
-
EOS
|
73
|
-
).strip
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
data/test/test_redcloth.rb
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/helper'
|
2
|
-
|
3
|
-
class TestRedCloth < Test::Unit::TestCase
|
4
|
-
|
5
|
-
context "RedCloth default (no explicit config) hard_breaks enabled" do
|
6
|
-
setup do
|
7
|
-
@textile = Converters::Textile.new
|
8
|
-
end
|
9
|
-
|
10
|
-
should "preserve single line breaks in HTML output" do
|
11
|
-
assert_equal "<p>line1<br />\nline2</p>", @textile.convert("p. line1\nline2").strip
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
context "Default hard_breaks enabled w/ redcloth section, no hard_breaks value" do
|
16
|
-
setup do
|
17
|
-
config = {
|
18
|
-
'redcloth' => {}
|
19
|
-
}
|
20
|
-
@textile = Converters::Textile.new config
|
21
|
-
end
|
22
|
-
|
23
|
-
should "preserve single line breaks in HTML output" do
|
24
|
-
assert_equal "<p>line1<br />\nline2</p>", @textile.convert("p. line1\nline2").strip
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
context "RedCloth with hard_breaks enabled" do
|
29
|
-
setup do
|
30
|
-
config = {
|
31
|
-
'redcloth' => {
|
32
|
-
'hard_breaks' => true # default
|
33
|
-
}
|
34
|
-
}
|
35
|
-
@textile = Converters::Textile.new config
|
36
|
-
end
|
37
|
-
|
38
|
-
should "preserve single line breaks in HTML output" do
|
39
|
-
assert_equal "<p>line1<br />\nline2</p>", @textile.convert("p. line1\nline2").strip
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
context "RedCloth with hard_breaks disabled" do
|
44
|
-
setup do
|
45
|
-
config = {
|
46
|
-
'redcloth' => {
|
47
|
-
'hard_breaks' => false
|
48
|
-
}
|
49
|
-
}
|
50
|
-
@textile = Converters::Textile.new config
|
51
|
-
end
|
52
|
-
|
53
|
-
should "not generate break tags in HTML output" do
|
54
|
-
assert_equal "<p>line1\nline2</p>", @textile.convert("p. line1\nline2").strip
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
context "RedCloth w/no_span_caps set to false" do
|
59
|
-
setup do
|
60
|
-
config = {
|
61
|
-
'redcloth' => {
|
62
|
-
'no_span_caps' => false
|
63
|
-
}
|
64
|
-
}
|
65
|
-
@textile = Converters::Textile.new config
|
66
|
-
end
|
67
|
-
should "generate span tags around capitalized words" do
|
68
|
-
assert_equal "<p><span class=\"caps\">NSC</span></p>", @textile.convert("NSC").strip
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
context "RedCloth w/no_span_caps set to true" do
|
73
|
-
setup do
|
74
|
-
config = {
|
75
|
-
'redcloth' => {
|
76
|
-
'no_span_caps' => true
|
77
|
-
}
|
78
|
-
}
|
79
|
-
@textile = Converters::Textile.new config
|
80
|
-
end
|
81
|
-
|
82
|
-
should "not generate span tags around capitalized words" do
|
83
|
-
assert_equal "<p>NSC</p>", @textile.convert("NSC").strip
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
data/test/test_related_posts.rb
DELETED
@@ -1,47 +0,0 @@
|
|
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
|
-
|
17
|
-
last_post = @site.posts.last
|
18
|
-
related_posts = Jekyll::RelatedPosts.new(last_post).build
|
19
|
-
|
20
|
-
last_10_recent_posts = (@site.posts.reverse - [last_post]).first(10)
|
21
|
-
assert_equal last_10_recent_posts, related_posts
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
context "building related posts with lsi" do
|
26
|
-
setup do
|
27
|
-
stub(Jekyll).configuration do
|
28
|
-
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir,
|
29
|
-
'destination' => dest_dir,
|
30
|
-
'lsi' => true})
|
31
|
-
end
|
32
|
-
any_instance_of(Jekyll::RelatedPosts) { |i| stub(i).display }
|
33
|
-
@site = Site.new(Jekyll.configuration)
|
34
|
-
end
|
35
|
-
|
36
|
-
should "use lsi for the related posts" do
|
37
|
-
@site.reset
|
38
|
-
@site.read
|
39
|
-
require 'classifier'
|
40
|
-
any_instance_of(::Classifier::LSI) do |c|
|
41
|
-
stub(c).find_related { @site.posts[-1..-9] }
|
42
|
-
stub(c).build_index
|
43
|
-
end
|
44
|
-
assert_equal @site.posts[-1..-9], Jekyll::RelatedPosts.new(@site.posts.last).build
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
data/test/test_sass.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
|
-
class TestSass < Test::Unit::TestCase
|
4
|
-
context "importing partials" do
|
5
|
-
setup do
|
6
|
-
@site = Jekyll::Site.new(Jekyll.configuration({
|
7
|
-
"source" => source_dir,
|
8
|
-
"destination" => dest_dir
|
9
|
-
}))
|
10
|
-
@site.process
|
11
|
-
@test_css_file = dest_dir("css/main.css")
|
12
|
-
end
|
13
|
-
|
14
|
-
should "import SCSS partial" do
|
15
|
-
assert_equal ".half {\n width: 50%; }\n", File.read(@test_css_file)
|
16
|
-
end
|
17
|
-
|
18
|
-
should "register the SCSS converter" do
|
19
|
-
assert !!@site.getConverterImpl(Jekyll::Converters::Scss), "SCSS converter implementation should exist."
|
20
|
-
end
|
21
|
-
|
22
|
-
should "register the Sass converter" do
|
23
|
-
assert !!@site.getConverterImpl(Jekyll::Converters::Sass), "Sass converter implementation should exist."
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
data/test/test_site.rb
DELETED
@@ -1,452 +0,0 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
|
-
class TestSite < Test::Unit::TestCase
|
4
|
-
context "configuring sites" do
|
5
|
-
should "have an array for plugins by default" do
|
6
|
-
site = Site.new(Jekyll::Configuration::DEFAULTS)
|
7
|
-
assert_equal [File.join(Dir.pwd, '_plugins')], site.plugins
|
8
|
-
end
|
9
|
-
|
10
|
-
should "look for plugins under the site directory by default" do
|
11
|
-
site = Site.new(Jekyll::Configuration::DEFAULTS.merge({'source' => File.expand_path(source_dir)}))
|
12
|
-
assert_equal [File.join(source_dir, '_plugins')], site.plugins
|
13
|
-
end
|
14
|
-
|
15
|
-
should "have an array for plugins if passed as a string" do
|
16
|
-
site = Site.new(Jekyll::Configuration::DEFAULTS.merge({'plugins' => '/tmp/plugins'}))
|
17
|
-
assert_equal ['/tmp/plugins'], site.plugins
|
18
|
-
end
|
19
|
-
|
20
|
-
should "have an array for plugins if passed as an array" do
|
21
|
-
site = Site.new(Jekyll::Configuration::DEFAULTS.merge({'plugins' => ['/tmp/plugins', '/tmp/otherplugins']}))
|
22
|
-
assert_equal ['/tmp/plugins', '/tmp/otherplugins'], site.plugins
|
23
|
-
end
|
24
|
-
|
25
|
-
should "have an empty array for plugins if nothing is passed" do
|
26
|
-
site = Site.new(Jekyll::Configuration::DEFAULTS.merge({'plugins' => []}))
|
27
|
-
assert_equal [], site.plugins
|
28
|
-
end
|
29
|
-
|
30
|
-
should "have an empty array for plugins if nil is passed" do
|
31
|
-
site = Site.new(Jekyll::Configuration::DEFAULTS.merge({'plugins' => nil}))
|
32
|
-
assert_equal [], site.plugins
|
33
|
-
end
|
34
|
-
|
35
|
-
should "expose default baseurl" do
|
36
|
-
site = Site.new(Jekyll::Configuration::DEFAULTS)
|
37
|
-
assert_equal Jekyll::Configuration::DEFAULTS['baseurl'], site.baseurl
|
38
|
-
end
|
39
|
-
|
40
|
-
should "expose baseurl passed in from config" do
|
41
|
-
site = Site.new(Jekyll::Configuration::DEFAULTS.merge({'baseurl' => '/blog'}))
|
42
|
-
assert_equal '/blog', site.baseurl
|
43
|
-
end
|
44
|
-
end
|
45
|
-
context "creating sites" do
|
46
|
-
setup do
|
47
|
-
stub(Jekyll).configuration do
|
48
|
-
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir})
|
49
|
-
end
|
50
|
-
@site = Site.new(Jekyll.configuration)
|
51
|
-
@num_invalid_posts = 2
|
52
|
-
end
|
53
|
-
|
54
|
-
should "have an empty tag hash by default" do
|
55
|
-
assert_equal Hash.new, @site.tags
|
56
|
-
end
|
57
|
-
|
58
|
-
should "give site with parsed pages and posts to generators" do
|
59
|
-
@site.reset
|
60
|
-
@site.read
|
61
|
-
class MyGenerator < Generator
|
62
|
-
def generate(site)
|
63
|
-
site.pages.dup.each do |page|
|
64
|
-
raise "#{page} isn't a page" unless page.is_a?(Page)
|
65
|
-
raise "#{page} doesn't respond to :name" unless page.respond_to?(:name)
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
@site.generate
|
70
|
-
assert_not_equal 0, @site.pages.size
|
71
|
-
end
|
72
|
-
|
73
|
-
should "reset data before processing" do
|
74
|
-
clear_dest
|
75
|
-
@site.process
|
76
|
-
before_posts = @site.posts.length
|
77
|
-
before_layouts = @site.layouts.length
|
78
|
-
before_categories = @site.categories.length
|
79
|
-
before_tags = @site.tags.length
|
80
|
-
before_pages = @site.pages.length
|
81
|
-
before_static_files = @site.static_files.length
|
82
|
-
before_time = @site.time
|
83
|
-
|
84
|
-
@site.process
|
85
|
-
assert_equal before_posts, @site.posts.length
|
86
|
-
assert_equal before_layouts, @site.layouts.length
|
87
|
-
assert_equal before_categories, @site.categories.length
|
88
|
-
assert_equal before_tags, @site.tags.length
|
89
|
-
assert_equal before_pages, @site.pages.length
|
90
|
-
assert_equal before_static_files, @site.static_files.length
|
91
|
-
assert before_time <= @site.time
|
92
|
-
end
|
93
|
-
|
94
|
-
should "write only modified static files" do
|
95
|
-
clear_dest
|
96
|
-
StaticFile.reset_cache
|
97
|
-
|
98
|
-
@site.process
|
99
|
-
some_static_file = @site.static_files[0].path
|
100
|
-
dest = File.expand_path(@site.static_files[0].destination(@site.dest))
|
101
|
-
mtime1 = File.stat(dest).mtime.to_i # first run must generate dest file
|
102
|
-
|
103
|
-
# need to sleep because filesystem timestamps have best resolution in seconds
|
104
|
-
sleep 1
|
105
|
-
@site.process
|
106
|
-
mtime2 = File.stat(dest).mtime.to_i
|
107
|
-
assert_equal mtime1, mtime2
|
108
|
-
|
109
|
-
# simulate file modification by user
|
110
|
-
FileUtils.touch some_static_file
|
111
|
-
|
112
|
-
sleep 1
|
113
|
-
@site.process
|
114
|
-
mtime3 = File.stat(dest).mtime.to_i
|
115
|
-
assert_not_equal mtime2, mtime3 # must be regenerated!
|
116
|
-
|
117
|
-
sleep 1
|
118
|
-
@site.process
|
119
|
-
mtime4 = File.stat(dest).mtime.to_i
|
120
|
-
assert_equal mtime3, mtime4 # no modifications, so must be the same
|
121
|
-
end
|
122
|
-
|
123
|
-
should "write static files if not modified but missing in destination" do
|
124
|
-
clear_dest
|
125
|
-
StaticFile.reset_cache
|
126
|
-
|
127
|
-
@site.process
|
128
|
-
some_static_file = @site.static_files[0].path
|
129
|
-
dest = File.expand_path(@site.static_files[0].destination(@site.dest))
|
130
|
-
mtime1 = File.stat(dest).mtime.to_i # first run must generate dest file
|
131
|
-
|
132
|
-
# need to sleep because filesystem timestamps have best resolution in seconds
|
133
|
-
sleep 1
|
134
|
-
@site.process
|
135
|
-
mtime2 = File.stat(dest).mtime.to_i
|
136
|
-
assert_equal mtime1, mtime2
|
137
|
-
|
138
|
-
# simulate destination file deletion
|
139
|
-
File.unlink dest
|
140
|
-
|
141
|
-
sleep 1
|
142
|
-
@site.process
|
143
|
-
mtime3 = File.stat(dest).mtime.to_i
|
144
|
-
assert_not_equal mtime2, mtime3 # must be regenerated and differ!
|
145
|
-
|
146
|
-
sleep 1
|
147
|
-
@site.process
|
148
|
-
mtime4 = File.stat(dest).mtime.to_i
|
149
|
-
assert_equal mtime3, mtime4 # no modifications, so must be the same
|
150
|
-
end
|
151
|
-
|
152
|
-
should "setup plugins in priority order" do
|
153
|
-
assert_equal @site.converters.sort_by(&:class).map{|c|c.class.priority}, @site.converters.map{|c|c.class.priority}
|
154
|
-
assert_equal @site.generators.sort_by(&:class).map{|g|g.class.priority}, @site.generators.map{|g|g.class.priority}
|
155
|
-
end
|
156
|
-
|
157
|
-
should "sort pages alphabetically" do
|
158
|
-
stub.proxy(Dir).entries { |entries| entries.reverse }
|
159
|
-
@site.process
|
160
|
-
# files in symlinked directories may appear twice
|
161
|
-
sorted_pages = %w(
|
162
|
-
%#\ +.md
|
163
|
-
.htaccess
|
164
|
-
about.html
|
165
|
-
bar.html
|
166
|
-
coffeescript.coffee
|
167
|
-
contacts.html
|
168
|
-
deal.with.dots.html
|
169
|
-
environment.html
|
170
|
-
exploit.md
|
171
|
-
foo.md
|
172
|
-
index.html
|
173
|
-
index.html
|
174
|
-
main.scss
|
175
|
-
main.scss
|
176
|
-
properties.html
|
177
|
-
sitemap.xml
|
178
|
-
static_files.html
|
179
|
-
symlinked-file
|
180
|
-
)
|
181
|
-
assert_equal sorted_pages, @site.pages.map(&:name)
|
182
|
-
end
|
183
|
-
|
184
|
-
should "read posts" do
|
185
|
-
@site.read_posts('')
|
186
|
-
posts = Dir[source_dir('_posts', '**', '*')]
|
187
|
-
posts.delete_if { |post| File.directory?(post) && !Post.valid?(post) }
|
188
|
-
assert_equal posts.size - @num_invalid_posts, @site.posts.size
|
189
|
-
end
|
190
|
-
|
191
|
-
should "read pages with yaml front matter" do
|
192
|
-
abs_path = File.expand_path("about.html", @site.source)
|
193
|
-
assert_equal true, @site.send(:has_yaml_header?, abs_path)
|
194
|
-
end
|
195
|
-
|
196
|
-
should "enforce a strict 3-dash limit on the start of the YAML front-matter" do
|
197
|
-
abs_path = File.expand_path("pgp.key", @site.source)
|
198
|
-
assert_equal false, @site.send(:has_yaml_header?, abs_path)
|
199
|
-
end
|
200
|
-
|
201
|
-
should "expose jekyll version to site payload" do
|
202
|
-
assert_equal Jekyll::VERSION, @site.site_payload['jekyll']['version']
|
203
|
-
end
|
204
|
-
|
205
|
-
should "expose list of static files to site payload" do
|
206
|
-
assert_equal @site.static_files, @site.site_payload['site']['static_files']
|
207
|
-
end
|
208
|
-
|
209
|
-
should "deploy payload" do
|
210
|
-
clear_dest
|
211
|
-
@site.process
|
212
|
-
|
213
|
-
posts = Dir[source_dir("**", "_posts", "**", "*")]
|
214
|
-
posts.delete_if { |post| File.directory?(post) && !Post.valid?(post) }
|
215
|
-
categories = %w(2013 bar baz category es foo z_category publish_test win).sort
|
216
|
-
|
217
|
-
assert_equal posts.size - @num_invalid_posts, @site.posts.size
|
218
|
-
assert_equal categories, @site.categories.keys.sort
|
219
|
-
assert_equal 5, @site.categories['foo'].size
|
220
|
-
end
|
221
|
-
|
222
|
-
context 'error handling' do
|
223
|
-
should "raise if destination is included in source" do
|
224
|
-
stub(Jekyll).configuration do
|
225
|
-
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => source_dir})
|
226
|
-
end
|
227
|
-
|
228
|
-
assert_raise Jekyll::Errors::FatalException do
|
229
|
-
site = Site.new(Jekyll.configuration)
|
230
|
-
end
|
231
|
-
end
|
232
|
-
|
233
|
-
should "raise if destination is source" do
|
234
|
-
stub(Jekyll).configuration do
|
235
|
-
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => File.join(source_dir, "..")})
|
236
|
-
end
|
237
|
-
|
238
|
-
assert_raise Jekyll::Errors::FatalException do
|
239
|
-
site = Site.new(Jekyll.configuration)
|
240
|
-
end
|
241
|
-
end
|
242
|
-
end
|
243
|
-
|
244
|
-
context 'with orphaned files in destination' do
|
245
|
-
setup do
|
246
|
-
clear_dest
|
247
|
-
@site.process
|
248
|
-
# generate some orphaned files:
|
249
|
-
# single file
|
250
|
-
File.open(dest_dir('obsolete.html'), 'w')
|
251
|
-
# single file in sub directory
|
252
|
-
FileUtils.mkdir(dest_dir('qux'))
|
253
|
-
File.open(dest_dir('qux/obsolete.html'), 'w')
|
254
|
-
# empty directory
|
255
|
-
FileUtils.mkdir(dest_dir('quux'))
|
256
|
-
FileUtils.mkdir(dest_dir('.git'))
|
257
|
-
FileUtils.mkdir(dest_dir('.svn'))
|
258
|
-
FileUtils.mkdir(dest_dir('.hg'))
|
259
|
-
# single file in repository
|
260
|
-
File.open(dest_dir('.git/HEAD'), 'w')
|
261
|
-
File.open(dest_dir('.svn/HEAD'), 'w')
|
262
|
-
File.open(dest_dir('.hg/HEAD'), 'w')
|
263
|
-
end
|
264
|
-
|
265
|
-
teardown do
|
266
|
-
FileUtils.rm_f(dest_dir('obsolete.html'))
|
267
|
-
FileUtils.rm_rf(dest_dir('qux'))
|
268
|
-
FileUtils.rm_f(dest_dir('quux'))
|
269
|
-
FileUtils.rm_rf(dest_dir('.git'))
|
270
|
-
FileUtils.rm_rf(dest_dir('.svn'))
|
271
|
-
FileUtils.rm_rf(dest_dir('.hg'))
|
272
|
-
end
|
273
|
-
|
274
|
-
should 'remove orphaned files in destination' do
|
275
|
-
@site.process
|
276
|
-
assert !File.exist?(dest_dir('obsolete.html'))
|
277
|
-
assert !File.exist?(dest_dir('qux'))
|
278
|
-
assert !File.exist?(dest_dir('quux'))
|
279
|
-
assert File.exist?(dest_dir('.git'))
|
280
|
-
assert File.exist?(dest_dir('.git/HEAD'))
|
281
|
-
end
|
282
|
-
|
283
|
-
should 'remove orphaned files in destination - keep_files .svn' do
|
284
|
-
config = Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'keep_files' => ['.svn']})
|
285
|
-
@site = Site.new(config)
|
286
|
-
@site.process
|
287
|
-
assert !File.exist?(dest_dir('.htpasswd'))
|
288
|
-
assert !File.exist?(dest_dir('obsolete.html'))
|
289
|
-
assert !File.exist?(dest_dir('qux'))
|
290
|
-
assert !File.exist?(dest_dir('quux'))
|
291
|
-
assert !File.exist?(dest_dir('.git'))
|
292
|
-
assert !File.exist?(dest_dir('.git/HEAD'))
|
293
|
-
assert File.exist?(dest_dir('.svn'))
|
294
|
-
assert File.exist?(dest_dir('.svn/HEAD'))
|
295
|
-
end
|
296
|
-
end
|
297
|
-
|
298
|
-
context 'using a non-default markdown processor in the configuration' do
|
299
|
-
should 'use the non-default markdown processor' do
|
300
|
-
class Jekyll::Converters::Markdown::CustomMarkdown
|
301
|
-
def initialize(*args)
|
302
|
-
@args = args
|
303
|
-
end
|
304
|
-
|
305
|
-
def convert(*args)
|
306
|
-
""
|
307
|
-
end
|
308
|
-
end
|
309
|
-
|
310
|
-
custom_processor = "CustomMarkdown"
|
311
|
-
s = Site.new(Jekyll.configuration.merge({ 'markdown' => custom_processor }))
|
312
|
-
assert_nothing_raised do
|
313
|
-
s.process
|
314
|
-
end
|
315
|
-
|
316
|
-
# Do some cleanup, we don't like straggling stuff's.
|
317
|
-
Jekyll::Converters::Markdown.send(:remove_const, :CustomMarkdown)
|
318
|
-
end
|
319
|
-
|
320
|
-
should 'ignore, if there are any bad characters in the class name' do
|
321
|
-
module Jekyll::Converters::Markdown::Custom
|
322
|
-
class Markdown
|
323
|
-
def initialize(*args)
|
324
|
-
@args = args
|
325
|
-
end
|
326
|
-
|
327
|
-
def convert(*args)
|
328
|
-
""
|
329
|
-
end
|
330
|
-
end
|
331
|
-
end
|
332
|
-
|
333
|
-
bad_processor = "Custom::Markdown"
|
334
|
-
s = Site.new(Jekyll.configuration.merge({ 'markdown' => bad_processor }))
|
335
|
-
assert_raise Jekyll::Errors::FatalException do
|
336
|
-
s.process
|
337
|
-
end
|
338
|
-
|
339
|
-
# Do some cleanup, we don't like straggling stuff's.
|
340
|
-
Jekyll::Converters::Markdown.send(:remove_const, :Custom)
|
341
|
-
end
|
342
|
-
end
|
343
|
-
|
344
|
-
context 'with an invalid markdown processor in the configuration' do
|
345
|
-
should 'not throw an error at initialization time' do
|
346
|
-
bad_processor = 'not a processor name'
|
347
|
-
assert_nothing_raised do
|
348
|
-
Site.new(Jekyll.configuration.merge({ 'markdown' => bad_processor }))
|
349
|
-
end
|
350
|
-
end
|
351
|
-
|
352
|
-
should 'throw FatalException at process time' do
|
353
|
-
bad_processor = 'not a processor name'
|
354
|
-
s = Site.new(Jekyll.configuration.merge({ 'markdown' => bad_processor }))
|
355
|
-
assert_raise Jekyll::Errors::FatalException do
|
356
|
-
s.process
|
357
|
-
end
|
358
|
-
end
|
359
|
-
end
|
360
|
-
|
361
|
-
context 'data directory' do
|
362
|
-
should 'auto load yaml files' do
|
363
|
-
site = Site.new(Jekyll.configuration)
|
364
|
-
site.process
|
365
|
-
|
366
|
-
file_content = SafeYAML.load_file(File.join(source_dir, '_data', 'members.yaml'))
|
367
|
-
|
368
|
-
assert_equal site.data['members'], file_content
|
369
|
-
assert_equal site.site_payload['site']['data']['members'], file_content
|
370
|
-
end
|
371
|
-
|
372
|
-
should 'auto load yml files' do
|
373
|
-
site = Site.new(Jekyll.configuration)
|
374
|
-
site.process
|
375
|
-
|
376
|
-
file_content = SafeYAML.load_file(File.join(source_dir, '_data', 'languages.yml'))
|
377
|
-
|
378
|
-
assert_equal site.data['languages'], file_content
|
379
|
-
assert_equal site.site_payload['site']['data']['languages'], file_content
|
380
|
-
end
|
381
|
-
|
382
|
-
should 'auto load json files' do
|
383
|
-
site = Site.new(Jekyll.configuration)
|
384
|
-
site.process
|
385
|
-
|
386
|
-
file_content = SafeYAML.load_file(File.join(source_dir, '_data', 'members.json'))
|
387
|
-
|
388
|
-
assert_equal site.data['members'], file_content
|
389
|
-
assert_equal site.site_payload['site']['data']['members'], file_content
|
390
|
-
end
|
391
|
-
|
392
|
-
should 'auto load yaml files in subdirectory' do
|
393
|
-
site = Site.new(Jekyll.configuration)
|
394
|
-
site.process
|
395
|
-
|
396
|
-
file_content = SafeYAML.load_file(File.join(source_dir, '_data', 'categories', 'dairy.yaml'))
|
397
|
-
|
398
|
-
assert_equal site.data['categories']['dairy'], file_content
|
399
|
-
assert_equal site.site_payload['site']['data']['categories']['dairy'], file_content
|
400
|
-
end
|
401
|
-
|
402
|
-
should "load symlink files in unsafe mode" do
|
403
|
-
site = Site.new(Jekyll.configuration.merge({'safe' => false}))
|
404
|
-
site.process
|
405
|
-
|
406
|
-
file_content = SafeYAML.load_file(File.join(source_dir, '_data', 'products.yml'))
|
407
|
-
|
408
|
-
assert_equal site.data['products'], file_content
|
409
|
-
assert_equal site.site_payload['site']['data']['products'], file_content
|
410
|
-
end
|
411
|
-
|
412
|
-
should "not load symlink files in safe mode" do
|
413
|
-
site = Site.new(Jekyll.configuration.merge({'safe' => true}))
|
414
|
-
site.process
|
415
|
-
|
416
|
-
assert_nil site.data['products']
|
417
|
-
assert_nil site.site_payload['site']['data']['products']
|
418
|
-
end
|
419
|
-
|
420
|
-
end
|
421
|
-
|
422
|
-
context "manipulating the Jekyll environment" do
|
423
|
-
setup do
|
424
|
-
@site = Site.new(site_configuration)
|
425
|
-
@site.process
|
426
|
-
@page = @site.pages.find { |p| p.name == "environment.html" }
|
427
|
-
end
|
428
|
-
|
429
|
-
should "default to 'development'" do
|
430
|
-
assert_equal "development", @page.content.strip
|
431
|
-
end
|
432
|
-
|
433
|
-
context "in production" do
|
434
|
-
setup do
|
435
|
-
ENV["JEKYLL_ENV"] = "production"
|
436
|
-
@site = Site.new(site_configuration)
|
437
|
-
@site.process
|
438
|
-
@page = @site.pages.find { |p| p.name == "environment.html" }
|
439
|
-
end
|
440
|
-
|
441
|
-
teardown do
|
442
|
-
ENV.delete("JEKYLL_ENV")
|
443
|
-
end
|
444
|
-
|
445
|
-
should "be overridden by JEKYLL_ENV" do
|
446
|
-
assert_equal "production", @page.content.strip
|
447
|
-
end
|
448
|
-
end
|
449
|
-
end
|
450
|
-
|
451
|
-
end
|
452
|
-
end
|