tigefa 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. data/History.markdown +0 -144
  2. data/LICENSE +1 -1
  3. data/README.markdown +6 -10
  4. data/Rakefile +6 -13
  5. data/bin/tigefa +22 -26
  6. data/features/create_sites.feature +0 -11
  7. data/features/include_tag.feature +0 -22
  8. data/features/markdown.feature +4 -41
  9. data/features/site_configuration.feature +4 -33
  10. data/features/site_data.feature +4 -4
  11. data/features/step_definitions/{tigefa_steps.rb → jekyll_steps.rb} +17 -32
  12. data/features/support/env.rb +2 -38
  13. data/lib/site_template/_config.yml +2 -2
  14. data/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +1 -0
  15. data/lib/site_template/css/main.css +15 -15
  16. data/lib/tigefa.rb +2 -5
  17. data/lib/tigefa/cleaner.rb +8 -8
  18. data/lib/tigefa/commands/build.rb +8 -14
  19. data/lib/tigefa/commands/new.rb +1 -1
  20. data/lib/tigefa/commands/serve.rb +0 -2
  21. data/lib/tigefa/configuration.rb +5 -21
  22. data/lib/tigefa/converters/markdown/kramdown_parser.rb +1 -1
  23. data/lib/tigefa/converters/markdown/maruku_parser.rb +1 -6
  24. data/lib/tigefa/convertible.rb +6 -17
  25. data/lib/tigefa/core_ext.rb +0 -19
  26. data/lib/tigefa/deprecator.rb +1 -1
  27. data/lib/tigefa/filters.rb +2 -12
  28. data/lib/tigefa/generators/pagination.rb +6 -9
  29. data/lib/tigefa/page.rb +1 -1
  30. data/lib/tigefa/post.rb +4 -4
  31. data/lib/tigefa/related_posts.rb +1 -1
  32. data/lib/tigefa/site.rb +50 -90
  33. data/lib/tigefa/stevenson.rb +4 -4
  34. data/lib/tigefa/tags/gist.rb +1 -9
  35. data/lib/tigefa/tags/highlight.rb +1 -1
  36. data/lib/tigefa/tags/include.rb +32 -75
  37. data/lib/tigefa/tags/post_url.rb +4 -6
  38. data/lib/tigefa/url.rb +0 -2
  39. data/site/_includes/docs_contents.html +1 -1
  40. data/site/_includes/docs_contents_mobile.html +1 -1
  41. data/site/_includes/top.html +1 -1
  42. data/site/docs/configuration.md +0 -19
  43. data/site/docs/deployment-methods.md +3 -3
  44. data/site/docs/drafts.md +3 -4
  45. data/site/docs/history.md +3 -147
  46. data/site/docs/installation.md +0 -10
  47. data/site/docs/migrations.md +240 -3
  48. data/site/docs/pages.md +7 -7
  49. data/site/docs/pagination.md +37 -16
  50. data/site/docs/plugins.md +7 -72
  51. data/site/docs/posts.md +1 -1
  52. data/site/docs/structure.md +0 -17
  53. data/site/docs/templates.md +7 -40
  54. data/site/docs/upgrading.md +3 -3
  55. data/site/docs/usage.md +1 -1
  56. data/site/docs/variables.md +2 -2
  57. data/test/helper.rb +1 -4
  58. data/test/test_configuration.rb +7 -16
  59. data/test/test_convertible.rb +1 -1
  60. data/test/test_excerpt.rb +3 -3
  61. data/test/test_filters.rb +0 -11
  62. data/test/test_generated_site.rb +1 -1
  63. data/test/test_kramdown.rb +5 -32
  64. data/test/test_new_command.rb +1 -1
  65. data/test/test_page.rb +0 -10
  66. data/test/test_post.rb +1 -12
  67. data/test/test_redcloth.rb +3 -3
  68. data/test/test_site.rb +64 -58
  69. data/test/test_tags.rb +35 -68
  70. data/tigefa.gemspec +15 -39
  71. metadata +101 -126
  72. checksums.yaml +0 -7
  73. data/features/data.feature +0 -65
  74. data/lib/tigefa/entry_filter.rb +0 -35
  75. data/site/_posts/2013-10-28-jekyll-1-3-0-rc1-released.markdown +0 -19
  76. data/site/_posts/2013-11-04-jekyll-1-3-0-released.markdown +0 -43
  77. data/site/_posts/2013-11-26-jekyll-1-3-1-released.markdown +0 -21
  78. data/site/_posts/2013-12-07-jekyll-1-4-0-released.markdown +0 -30
  79. data/site/_posts/2013-12-16-jekyll-1-4-2-released.markdown +0 -18
  80. data/site/_posts/2014-01-13-jekyll-1-4-3-released.markdown +0 -27
  81. data/site/docs/datafiles.md +0 -63
  82. data/test/source/_config.dev.toml +0 -2
  83. data/test/source/_data/languages.yml +0 -2
  84. data/test/source/_data/members.yaml +0 -7
  85. data/test/source/_data/products.yml +0 -1
  86. data/test/source/_includes/tmp +0 -1
  87. data/test/source/_layouts/post/simple.html +0 -1
  88. data/test/source/_posts/2014-01-06-permalink-traversal.md +0 -5
  89. data/test/source/exploit.md +0 -5
  90. data/test/source/products.yml +0 -4
  91. data/test/source/symlink-test/_data +0 -1
  92. data/test/test_entry_filter.rb +0 -74
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: f57331b1db378c3cc4e6ba0e683cbce9bd95f1bd
4
- data.tar.gz: b2f4a0d9c6792ff0d489c7968da1fb07ff1a5d51
5
- SHA512:
6
- metadata.gz: c9d05edf9e30a706f2d6e47c19b6d5c5297c04634a4203d10ba7149796ff26e268b4d083ad6f18ec9ec7b504eca429a5ece24e0e524f8dd80e4e8a9aae89054a
7
- data.tar.gz: 86ab6f8e9f503c7183f746224d26d13c72eafed7573dac0634546f702afd4f619e19310d81e950c7c0030037c76e076e6a26cb1cfbcb1a77ae2384d52d3f0502
@@ -1,65 +0,0 @@
1
- Feature: Data
2
- In order to use well-formatted data in my blog
3
- As a blog's user
4
- I want to use _data directory in my site
5
-
6
- Scenario: autoload *.yaml files in _data directory
7
- Given I have a _data directory
8
- And I have a "_data/products.yaml" file with content:
9
- """
10
- - name: sugar
11
- price: 5.3
12
- - name: salt
13
- price: 2.5
14
- """
15
- And I have an "index.html" page that contains "{% for product in site.data.products %}{{product.name}}{% endfor %}"
16
- When I run jekyll
17
- Then the "_site/index.html" file should exist
18
- And I should see "sugar" in "_site/index.html"
19
- And I should see "salt" in "_site/index.html"
20
-
21
- Scenario: autoload *.yml files in _data directory
22
- Given I have a _data directory
23
- And I have a "_data/members.yml" file with content:
24
- """
25
- - name: Jack
26
- age: 28
27
- - name: Leon
28
- age: 34
29
- """
30
- And I have an "index.html" page that contains "{% for member in site.data.members %}{{member.name}}{% endfor %}"
31
- When I run jekyll
32
- Then the "_site/index.html" file should exist
33
- And I should see "Jack" in "_site/index.html"
34
- And I should see "Leon" in "_site/index.html"
35
-
36
- Scenario: autoload *.yml files in _data directory with space in file name
37
- Given I have a _data directory
38
- And I have a "_data/team members.yml" file with content:
39
- """
40
- - name: Jack
41
- age: 28
42
- - name: Leon
43
- age: 34
44
- """
45
- And I have an "index.html" page that contains "{% for member in site.data.team_members %}{{member.name}}{% endfor %}"
46
- When I run jekyll
47
- Then the "_site/index.html" file should exist
48
- And I should see "Jack" in "_site/index.html"
49
- And I should see "Leon" in "_site/index.html"
50
-
51
- Scenario: should be backward compatible with site.data in _config.yml
52
- Given I have a "_config.yml" file with content:
53
- """
54
- data:
55
- - name: Jack
56
- age: 28
57
- - name: Leon
58
- age: 34
59
- """
60
- And I have an "index.html" page that contains "{% for member in site.data %}{{member.name}}{% endfor %}"
61
- When I run jekyll
62
- Then the "_site/index.html" file should exist
63
- And I should see "Jack" in "_site/index.html"
64
- And I should see "Leon" in "_site/index.html"
65
-
@@ -1,35 +0,0 @@
1
- class EntryFilter
2
- attr_reader :site
3
- def initialize(site)
4
- @site = site
5
- end
6
-
7
- def filter(entries)
8
- entries.reject do |e|
9
- unless included?(e)
10
- special?(e) || backup?(e) || excluded?(e) || symlink?(e)
11
- end
12
- end
13
- end
14
-
15
- def included?(entry)
16
- site.include.glob_include?(entry)
17
- end
18
-
19
- def special?(entry)
20
- ['.', '_', '#'].include?(entry[0..0])
21
- end
22
-
23
- def backup?(entry)
24
- entry[-1..-1] == '~'
25
- end
26
-
27
- def excluded?(entry)
28
- site.exclude.glob_include?(entry)
29
- end
30
-
31
- def symlink?(entry)
32
- File.symlink?(entry) && site.safe
33
- end
34
-
35
- end
@@ -1,19 +0,0 @@
1
- ---
2
- layout: news_item
3
- title: 'Jekyll 1.3.0.rc1 Released'
4
- date: 2013-10-28 20:14:39 -0500
5
- author: mattr-
6
- version: 1.3.0.rc1
7
- categories: [release]
8
- ---
9
-
10
- Jekyll 1.3.0 is going to be a big release! In order to make sure we
11
- didn't screw anything up too badly, we're making a release candidate
12
- available for any early adopters who want to give the latest and
13
- greatest code a spin without having to clone a repository from git.
14
-
15
- Please take this prerelease for a spin and [let us
16
- know](https://github.com/mojombo/jekyll/issues/new) if you run into any
17
- issues!
18
-
19
-
@@ -1,43 +0,0 @@
1
- ---
2
- layout: news_item
3
- title: 'Jekyll 1.3.0 Released'
4
- date: 2013-11-04 21:46:02 -0600
5
- author: mattr-
6
- version: 1.3.0
7
- categories: [release]
8
- ---
9
-
10
- It's been about six weeks since v1.2.0 and the Jekyll team is happy to
11
- announce the arrival of v1.3.0. This is a **huge** release full of all
12
- sorts of new features, bug fixes, and other things that you're sure to
13
- love.
14
-
15
- Here are a few things we think you'll want to know about this release:
16
-
17
- * You can add [arbitrary data][] to the site by adding YAML files under a
18
- site's `_data` directory. This will allow you to avoid
19
- repetition in your templates and to set site specific options without
20
- changing `_config.yml`.
21
-
22
- * You can now run `jekyll serve --detach` to boot up a WEBrick server in the
23
- background. **Note:** you'll need to run `kill [server_pid]` to shut
24
- the server down. When ran, you'll get a process id that you can use in
25
- place of `[server_pid]`
26
-
27
- * You can now **disable automatically-generated excerpts** if you set
28
- `excerpt_separator` to `""`.
29
-
30
- * If you're moving pages and posts, you can now check for **URL
31
- conflicts** by running `jekyll doctor`.
32
-
33
- * If you're a fan of the drafts feature, you'll be happy to know we've
34
- added `-D`, a shortened version of `--drafts`.
35
-
36
- * Permalinks with special characters should now generate without errors.
37
-
38
- * Expose the current Jekyll version as the `jekyll.version` Liquid
39
- variable.
40
-
41
- For a full run-down, visit our [change log](/docs/history/)!
42
-
43
- [arbitrary data]: /docs/datafiles/
@@ -1,21 +0,0 @@
1
- ---
2
- layout: news_item
3
- title: 'Jekyll 1.3.1 Released'
4
- date: 2013-11-26 19:52:20 -0600
5
- author: mattr-
6
- version: 1.3.1
7
- categories: [release]
8
- ---
9
-
10
- Just in time for the US holiday Thanksgiving, we're releasing version
11
- 1.3.1 of Jekyll to address some of the issues seen since the
12
- release of 1.3.0.
13
-
14
- In addition to a couple of other smaller bug fixes, the biggest thing
15
- we've fixed is an issue with the `--watch` option with Ruby 1.8.7. For a
16
- full run-down, visit our [change log](/docs/history/)!
17
-
18
- Thanks to all the people who have contributed to this release! They are
19
- (in alphabetical order): Abhi Yerra, Anatol Broder, Andreas Möller, Greg
20
- Karékinian, Sam Rayner, Santeri Paavolainen, Shigeya Suzuki, Yihang Ho,
21
- albertogg, andrewhavens, maul.esel, and thomasdao
@@ -1,30 +0,0 @@
1
- ---
2
- layout: news_item
3
- title: 'Jekyll 1.4.0 Released'
4
- date: 2013-12-07 13:55:28 -0600
5
- author: mattr-
6
- version: 1.4.0
7
- categories: [release]
8
- ---
9
-
10
- About a month after the release of Jekyll v1.3.0, we are releasing
11
- Jekyll v1.4.0. This release will be the last non-patch release to support Ruby
12
- 1.8.7 and our next release will be Jekyll 2.0.0.
13
-
14
- Here are a few things we think you'll want to know about this release:
15
-
16
- * TOML is now a supported markup language for config files.
17
-
18
- * Maruku has been updated to 0.7.0 which provides some new features and
19
- a ton of bugfixes over the previous 0.6.x releases.
20
-
21
- * Non-`gem` Plugins are now sorted alphabetically by filename before they're
22
- processed, which can provide a rudimentary way to establish a load order for
23
- plugins.
24
-
25
- For a full run-down, visit our [change log](/docs/history/)!
26
-
27
- As always, Jekyll wouldn't be possible without the contributions from
28
- others in the Jekyll community. We'd like to thank the following people
29
- for contributing to this release: Anatol Broder, David Sawyer, Greg
30
- Karékinian, Jordon Bedwell, Matthew Iversen, Persa Zula, and Yi Zeng.
@@ -1,18 +0,0 @@
1
- ---
2
- layout: news_item
3
- title: 'Jekyll 1.4.2 Released'
4
- date: 2013-12-16 19:48:13 -0500
5
- author: parkr
6
- version: 1.4.2
7
- categories: [release]
8
- ---
9
-
10
- This release fixes [a regression][] where Maruku fenced code blocks were turned
11
- off, instead of the previous default to on. We've added a new default
12
- configuration to our `maruku` config key: `fenced_code_blocks` and set it to
13
- default to `true`.
14
-
15
- If you do not wish to use Maruku fenced code blocks, you may turn this option
16
- off in your site's configuration file.
17
-
18
- [a regression]: https://github.com/jekyll/jekyll/pull/1830
@@ -1,27 +0,0 @@
1
- ---
2
- layout: news_item
3
- title: 'Jekyll 1.4.3 Released'
4
- date: 2014-01-13 17:43:32 -0800
5
- author: benbalter
6
- version: 1.4.3
7
- categories: [release]
8
- ---
9
-
10
- Jekyll 1.4.3 contains two **critical** security fixes. If you run Jekyll locally
11
- and do not run Jekyll in "safe" mode (e.g. you do not build Jekyll sites on behalf
12
- of others), you are not affected and are not required to update at this time.
13
- ([See pull request.]({{ site.repository }}/pull/1944))
14
-
15
- Versions of Jekyll prior to 1.4.3 and greater than 1.2.0 may allow malicious
16
- users to expose the content of files outside the source directory in the
17
- generated output via improper symlink sanitization, potentially resulting in an
18
- inadvertent information disclosure.
19
-
20
- Versions of Jekyll prior to 1.4.3 may also allow malicious users to write
21
- arbitrary `.html` files outside of the destination folder via relative path
22
- traversal, potentially overwriting otherwise-trusted content with arbitrary HTML
23
- or Javascript depending on your server's configuration.
24
-
25
- *Maintainer's note: Many thanks to @gregose and @charliesome for discovering
26
- these vulnerabilities, and to @BenBalter and @alindeman for writing the patch.
27
- -@parkr*
@@ -1,63 +0,0 @@
1
- ---
2
- layout: docs
3
- title: Data Files
4
- prev_section: variables
5
- next_section: migrations
6
- permalink: /docs/datafiles/
7
- ---
8
-
9
- In addition to the [built-in variables](../variables/) available from Jekyll,
10
- you can specify your own custom data that can be accessed via the [Liquid
11
- templating system](http://wiki.github.com/shopify/liquid/liquid-for-designers).
12
-
13
- Jekyll supports loading data from [YAML](http://yaml.org/) files located in the
14
- `_data` directory.
15
-
16
- This powerful features allows you to avoid repetition in your templates and to
17
- set site specific options without changing `_config.yml`.
18
-
19
- Plugins/themes can also leverage Data Files to set configuration variables.
20
-
21
- ## The Data Folder
22
-
23
- As explained on the [directory structure](../structure/) page, the `_data`
24
- folder is where you can store additional data for Jekyll to use when generating
25
- your site. These files must be YAML files (using either the `.yml` or `.yaml`
26
- extension) and they will be accessible via `site.data`.
27
-
28
- ## Example: List of members
29
-
30
- Here is a basic example of using Data Files to avoid copy-pasting large chunks of
31
- code in your Jekyll templates:
32
-
33
- In `_data/members.yml`:
34
-
35
- {% highlight yaml %}
36
- - name: Tom Preston-Werner
37
- github: mojombo
38
-
39
- - name: Parker Moore
40
- github: parkr
41
-
42
- - name: Liu Fengyun
43
- github: liufengyun
44
- {% endhighlight %}
45
-
46
- This data can be accessed via `site.data.members` (notice that the filename
47
- determines the variable name).
48
-
49
- You can now render the list of members in a template:
50
-
51
- {% highlight html %}
52
- {% raw %}
53
- <ul>
54
- {% for member in site.data.members %}
55
- <li>
56
- <a href="https://github.com/{{ member.github }}">
57
- {{ member.name }}
58
- </a>
59
- </li>
60
- {% endfor %}
61
- </ul>
62
- {% endraw %}
63
- {% endhighlight %}
@@ -1,2 +0,0 @@
1
- baseurl = "/you-beautiful-blog-you"
2
- title = "My magnificent site, wut"
@@ -1,2 +0,0 @@
1
- - java
2
- - ruby
@@ -1,7 +0,0 @@
1
- - name: Jack
2
- age: 27
3
- blog: http://example.com/jack
4
-
5
- - name: John
6
- age: 32
7
- blog: http://example.com/john
@@ -1 +0,0 @@
1
- ../products.yml
@@ -1 +0,0 @@
1
- /tmp
@@ -1 +0,0 @@
1
- <<< {{ content }} >>>
@@ -1,5 +0,0 @@
1
- ---
2
- permalink: /%2e%2e/%2e%2e/%2e%2e/baddie.html
3
- ---
4
-
5
- # Test
@@ -1,5 +0,0 @@
1
- ---
2
- permalink: /%2e%2e/%2e%2e/%2e%2e/baddie.html
3
- ---
4
-
5
- # Test
@@ -1,4 +0,0 @@
1
- - name: sugar
2
- price: 5.3
3
- - name: salt
4
- price: 2.5
@@ -1 +0,0 @@
1
- ../_data
@@ -1,74 +0,0 @@
1
- require 'helper'
2
-
3
- class TestEntryFilter < Test::Unit::TestCase
4
- context "Filtering entries" do
5
- setup do
6
- stub(Tigefa).configuration do
7
- Tigefa::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir})
8
- end
9
- @site = Site.new(Tigefa.configuration)
10
- end
11
-
12
- should "filter entries" do
13
- ent1 = %w[foo.markdown bar.markdown baz.markdown #baz.markdown#
14
- .baz.markdow foo.markdown~ .htaccess _posts _pages]
15
-
16
- entries = EntryFilter.new(@site).filter(ent1)
17
- assert_equal %w[foo.markdown bar.markdown baz.markdown .htaccess], entries
18
- end
19
-
20
- should "filter entries with exclude" do
21
- excludes = %w[README TODO]
22
- files = %w[index.html site.css .htaccess]
23
-
24
- @site.exclude = excludes + ["exclude*"]
25
- assert_equal files, @site.filter_entries(excludes + files + ["excludeA"])
26
- end
27
-
28
- should "not filter entries within include" do
29
- includes = %w[_index.html .htaccess include*]
30
- files = %w[index.html _index.html .htaccess includeA]
31
-
32
- @site.include = includes
33
- assert_equal files, @site.filter_entries(files)
34
- end
35
-
36
- should "filter symlink entries when safe mode enabled" do
37
- stub(Tigefa).configuration do
38
- Tigefa::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'safe' => true})
39
- end
40
- site = Site.new(Tigefa.configuration)
41
- stub(File).symlink?('symlink.js') {true}
42
- files = %w[symlink.js]
43
- assert_equal [], site.filter_entries(files)
44
- end
45
-
46
- should "not filter symlink entries when safe mode disabled" do
47
- stub(File).symlink?('symlink.js') {true}
48
- files = %w[symlink.js]
49
- assert_equal files, @site.filter_entries(files)
50
- end
51
-
52
- should "not include symlinks in safe mode" do
53
- stub(Tigefa).configuration do
54
- Tigefa::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'safe' => true})
55
- end
56
- site = Site.new(Tigefa.configuration)
57
-
58
- site.read_directories("symlink-test")
59
- assert_equal [], site.pages
60
- assert_equal [], site.static_files
61
- end
62
-
63
- should "include symlinks in unsafe mode" do
64
- stub(Tigefa).configuration do
65
- Tigefa::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'safe' => false})
66
- end
67
- site = Site.new(Tigefa.configuration)
68
-
69
- site.read_directories("symlink-test")
70
- assert_not_equal [], site.pages
71
- assert_not_equal [], site.static_files
72
- end
73
- end
74
- end