mojombo-jekyll 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,6 @@
1
+ test/dest
2
+ *.gem
3
+ pkg/
4
+ *.swp
5
+ *~
6
+ _site/
@@ -1,3 +1,7 @@
1
+ == 0.5.4 / 2009-08-23
2
+ * Bug Fixes
3
+ * Do not allow symlinks (security vulnerability)
4
+
1
5
  == 0.5.3 / 2009-07-14
2
6
  * Bug Fixes
3
7
  * Solving the permalink bug where non-html files wouldn't work [github.com/jeffrydegrande]
@@ -1,4 +1,4 @@
1
1
  ---
2
+ :patch: 4
2
3
  :major: 0
3
4
  :minor: 5
4
- :patch: 3
@@ -0,0 +1,46 @@
1
+ Feature: Create sites
2
+ As a hacker who likes to blog
3
+ I want to be able to make a static site
4
+ In order to share my awesome ideas with the interwebs
5
+
6
+ Scenario: Basic site
7
+ Given I have an "index.html" file that contains "Basic Site"
8
+ When I run jekyll
9
+ Then the _site directory should exist
10
+ And I should see "Basic Site" in "_site/index.html"
11
+
12
+ Scenario: Basic site with a post
13
+ Given I have a _posts directory
14
+ And I have the following post:
15
+ | title | date | content |
16
+ | Hackers | 3/27/2009 | My First Exploit |
17
+ When I run jekyll
18
+ Then the _site directory should exist
19
+ And I should see "My First Exploit" in "_site/2009/03/27/hackers.html"
20
+
21
+ Scenario: Basic site with layout and a page
22
+ Given I have a _layouts directory
23
+ And I have an "index.html" page with layout "default" that contains "Basic Site with Layout"
24
+ And I have a default layout that contains "Page Layout: {{ content }}"
25
+ When I run jekyll
26
+ Then the _site directory should exist
27
+ And I should see "Page Layout: Basic Site with Layout" in "_site/index.html"
28
+
29
+ Scenario: Basic site with layout and a post
30
+ Given I have a _layouts directory
31
+ And I have a _posts directory
32
+ And I have the following post:
33
+ | title | date | layout | content |
34
+ | Wargames | 3/27/2009 | default | The only winning move is not to play. |
35
+ And I have a default layout that contains "Post Layout: {{ content }}"
36
+ When I run jekyll
37
+ Then the _site directory should exist
38
+ And I should see "Post Layout: <p>The only winning move is not to play.</p>" in "_site/2009/03/27/wargames.html"
39
+
40
+ Scenario: Basic site with include tag
41
+ Given I have a _includes directory
42
+ And I have an "index.html" page that contains "Basic Site with include tag: {% include about.textile %}"
43
+ And I have an "_includes/about.textile" file that contains "Generated by Jekyll"
44
+ When I run jekyll
45
+ Then the _site directory should exist
46
+ And I should see "Basic Site with include tag: Generated by Jekyll" in "_site/index.html"
@@ -0,0 +1,60 @@
1
+ Feature: Embed filters
2
+ As a hacker who likes to blog
3
+ I want to be able to transform text inside a post or page
4
+ In order to perform cool stuff in my posts
5
+
6
+ Scenario: Convert date to XML schema
7
+ Given I have a _posts directory
8
+ And I have a _layouts directory
9
+ And I have the following post:
10
+ | title | date | layout | content |
11
+ | Star Wars | 3/27/2009 | default | These aren't the droids you're looking for. |
12
+ And I have a default layout that contains "{{ site.time | date_to_xmlschema }}"
13
+ When I run jekyll
14
+ Then the _site directory should exist
15
+ And I should see today's date in "_site/2009/03/27/star-wars.html"
16
+
17
+ Scenario: Escape text for XML
18
+ Given I have a _posts directory
19
+ And I have a _layouts directory
20
+ And I have the following post:
21
+ | title | date | layout | content |
22
+ | Star & Wars | 3/27/2009 | default | These aren't the droids you're looking for. |
23
+ And I have a default layout that contains "{{ site.posts.first.title | xml_escape }}"
24
+ When I run jekyll
25
+ Then the _site directory should exist
26
+ And I should see "Star &amp; Wars" in "_site/2009/03/27/star-wars.html"
27
+
28
+ Scenario: Calculate number of words
29
+ Given I have a _posts directory
30
+ And I have a _layouts directory
31
+ And I have the following post:
32
+ | title | date | layout | content |
33
+ | Star Wars | 3/27/2009 | default | These aren't the droids you're looking for. |
34
+ And I have a default layout that contains "{{ site.posts.first.content | xml_escape }}"
35
+ When I run jekyll
36
+ Then the _site directory should exist
37
+ And I should see "7" in "_site/2009/03/27/star-wars.html"
38
+
39
+ Scenario: Convert an array into a sentence
40
+ Given I have a _posts directory
41
+ And I have a _layouts directory
42
+ And I have the following post:
43
+ | title | date | layout | tags | content |
44
+ | Star Wars | 3/27/2009 | default | [scifi, movies, force] | These aren't the droids you're looking for. |
45
+ And I have a default layout that contains "{{ site.posts.first.tags | array_to_sentence_string }}"
46
+ When I run jekyll
47
+ Then the _site directory should exist
48
+ And I should see "scifi, movies, and force" in "_site/2009/03/27/star-wars.html"
49
+
50
+ Scenario: Textilize a given string
51
+ Given I have a _posts directory
52
+ And I have a _layouts directory
53
+ And I have the following post:
54
+ | title | date | layout | content |
55
+ | Star Wars | 3/27/2009 | default | These aren't the droids you're looking for. |
56
+ And I have a default layout that contains "By {{ '_Obi-wan_' | textilize }}"
57
+ When I run jekyll
58
+ Then the _site directory should exist
59
+ And I should see "By <p><em>Obi-wan</em></p>" in "_site/2009/03/27/star-wars.html"
60
+
@@ -0,0 +1,40 @@
1
+ Feature: Site pagination
2
+ In order to paginate my blog
3
+ As a blog's user
4
+ I want divide the posts in several pages
5
+
6
+ Scenario Outline: Paginate with N posts per page
7
+ Given I have a configuration file with "paginate" set to "<num>"
8
+ And I have a _layouts directory
9
+ And I have an "index.html" file that contains "Basic Site"
10
+ And I have a _posts directory
11
+ And I have the following post:
12
+ | title | date | layout | content |
13
+ | Wargames | 3/27/2009 | default | The only winning move is not to play. |
14
+ | Wargames2 | 4/27/2009 | default | The only winning move is not to play2. |
15
+ | Wargames3 | 5/27/2009 | default | The only winning move is not to play2. |
16
+ When I run jekyll
17
+ Then the _site/page2 directory should exist
18
+ And the _site/page2/index.html file should exist
19
+
20
+ Examples:
21
+ | num |
22
+ | 1 |
23
+ | 2 |
24
+
25
+ Scenario: Correct liquid paginator replacements
26
+ Given I have a configuration file with "paginate" set to "1"
27
+ And I have a _layouts directory
28
+ And I have an "index.html" file that contains "{{ paginator.page }}"
29
+ And I have a _posts directory
30
+ And I have the following post:
31
+ | title | date | layout | content |
32
+ | Wargames | 3/27/2009 | default | The only winning move is not to play. |
33
+ | Wargames2 | 4/27/2009 | default | The only winning move is not to play2. |
34
+ When I run jekyll
35
+ Then the _site/index.html file should exist
36
+ And I should see "1" in "_site/index.html"
37
+ Then the _site/page2 directory should exist
38
+ And the _site/page2/index.html file should exist
39
+ And I should see "2" in "_site/page2/index.html"
40
+
@@ -0,0 +1,65 @@
1
+ Feature: Fancy permalinks
2
+ As a hacker who likes to blog
3
+ I want to be able to set permalinks
4
+ In order to make my blog URLs awesome
5
+
6
+ Scenario: Use none permalink schema
7
+ Given I have a _posts directory
8
+ And I have the following post:
9
+ | title | date | content |
10
+ | None Permalink Schema | 3/27/2009 | Totally nothing. |
11
+ And I have a configuration file with "permalink" set to "none"
12
+ When I run jekyll
13
+ Then the _site directory should exist
14
+ And I should see "Totally nothing." in "_site/none-permalink-schema.html"
15
+
16
+ Scenario: Use pretty permalink schema
17
+ Given I have a _posts directory
18
+ And I have the following post:
19
+ | title | date | content |
20
+ | Pretty Permalink Schema | 3/27/2009 | Totally wordpress. |
21
+ And I have a configuration file with "permalink" set to "pretty"
22
+ When I run jekyll
23
+ Then the _site directory should exist
24
+ And I should see "Totally wordpress." in "_site/2009/03/27/pretty-permalink-schema/index.html"
25
+
26
+ Scenario: Use pretty permalink schema for pages
27
+ Given I have an "index.html" page that contains "Totally index"
28
+ And I have an "awesome.html" page that contains "Totally awesome"
29
+ And I have an "sitemap.xml" page that contains "Totally uhm, sitemap"
30
+ And I have a configuration file with "permalink" set to "pretty"
31
+ When I run jekyll
32
+ Then the _site directory should exist
33
+ And I should see "Totally index" in "_site/index.html"
34
+ And I should see "Totally awesome" in "_site/awesome/index.html"
35
+ And I should see "Totally uhm, sitemap" in "_site/sitemap.xml"
36
+
37
+ Scenario: Use custom permalink schema with prefix
38
+ Given I have a _posts directory
39
+ And I have the following post:
40
+ | title | category | date | content |
41
+ | Custom Permalink Schema | stuff | 3/27/2009 | Totally custom. |
42
+ And I have a configuration file with "permalink" set to "/blog/:year/:month/:day/:title"
43
+ When I run jekyll
44
+ Then the _site directory should exist
45
+ And I should see "Totally custom." in "_site/blog/2009/03/27/custom-permalink-schema/index.html"
46
+
47
+ Scenario: Use custom permalink schema with category
48
+ Given I have a _posts directory
49
+ And I have the following post:
50
+ | title | category | date | content |
51
+ | Custom Permalink Schema | stuff | 3/27/2009 | Totally custom. |
52
+ And I have a configuration file with "permalink" set to "/:categories/:title.html"
53
+ When I run jekyll
54
+ Then the _site directory should exist
55
+ And I should see "Totally custom." in "_site/stuff/custom-permalink-schema.html"
56
+
57
+ Scenario: Use custom permalink schema with squished date
58
+ Given I have a _posts directory
59
+ And I have the following post:
60
+ | title | category | date | content |
61
+ | Custom Permalink Schema | stuff | 3/27/2009 | Totally custom. |
62
+ And I have a configuration file with "permalink" set to "/:month-:day-:year/:title.html"
63
+ When I run jekyll
64
+ Then the _site directory should exist
65
+ And I should see "Totally custom." in "_site/03-27-2009/custom-permalink-schema.html"
@@ -0,0 +1,153 @@
1
+ Feature: Post data
2
+ As a hacker who likes to blog
3
+ I want to be able to embed data into my posts
4
+ In order to make the posts slightly dynamic
5
+
6
+ Scenario: Use post.title variable
7
+ Given I have a _posts directory
8
+ And I have a _layouts directory
9
+ And I have the following post:
10
+ | title | date | layout | content |
11
+ | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
12
+ And I have a simple layout that contains "Post title: {{ site.posts.first.title }}"
13
+ When I run jekyll
14
+ Then the _site directory should exist
15
+ And I should see "Post title: Star Wars" in "_site/2009/03/27/star-wars.html"
16
+
17
+ Scenario: Use post.url variable
18
+ Given I have a _posts directory
19
+ And I have a _layouts directory
20
+ And I have the following post:
21
+ | title | date | layout | content |
22
+ | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
23
+ And I have a simple layout that contains "Post url: {{ site.posts.first.url }}"
24
+ When I run jekyll
25
+ Then the _site directory should exist
26
+ And I should see "Post url: /2009/03/27/star-wars.html" in "_site/2009/03/27/star-wars.html"
27
+
28
+ Scenario: Use post.date variable
29
+ Given I have a _posts directory
30
+ And I have a _layouts directory
31
+ And I have the following post:
32
+ | title | date | layout | content |
33
+ | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
34
+ And I have a simple layout that contains "Post date: {{ site.posts.first.date }}"
35
+ When I run jekyll
36
+ Then the _site directory should exist
37
+ And I should see "Post date: Fri Mar 27" in "_site/2009/03/27/star-wars.html"
38
+
39
+ Scenario: Use post.id variable
40
+ Given I have a _posts directory
41
+ And I have a _layouts directory
42
+ And I have the following post:
43
+ | title | date | layout | content |
44
+ | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
45
+ And I have a simple layout that contains "Post id: {{ site.posts.first.id }}"
46
+ When I run jekyll
47
+ Then the _site directory should exist
48
+ And I should see "Post id: /2009/03/27/star-wars" in "_site/2009/03/27/star-wars.html"
49
+
50
+ Scenario: Use post.content variable
51
+ Given I have a _posts directory
52
+ And I have a _layouts directory
53
+ And I have the following post:
54
+ | title | date | layout | content |
55
+ | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
56
+ And I have a simple layout that contains "Post content: {{ site.posts.first.content }}"
57
+ When I run jekyll
58
+ Then the _site directory should exist
59
+ And I should see "Post content: <p>Luke, I am your father.</p>" in "_site/2009/03/27/star-wars.html"
60
+
61
+ Scenario: Use post.categories variable when category is in a folder
62
+ Given I have a movies directory
63
+ And I have a movies/_posts directory
64
+ And I have a _layouts directory
65
+ And I have the following post in "movies":
66
+ | title | date | layout | content |
67
+ | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
68
+ And I have a simple layout that contains "Post category: {{ site.posts.first.categories }}"
69
+ When I run jekyll
70
+ Then the _site directory should exist
71
+ And I should see "Post category: movies" in "_site/movies/2009/03/27/star-wars.html"
72
+
73
+ Scenario: Use post.tags variable
74
+ Given I have a _posts directory
75
+ And I have a _layouts directory
76
+ And I have the following post:
77
+ | title | date | layout | tag | content |
78
+ | Star Wars | 5/18/2009 | simple | twist | Luke, I am your father. |
79
+ And I have a simple layout that contains "Post tags: {{ site.posts.first.tags }}"
80
+ When I run jekyll
81
+ Then the _site directory should exist
82
+ And I should see "Post tags: twist" in "_site/2009/05/18/star-wars.html"
83
+
84
+ Scenario: Use post.categories variable when categories are in folders
85
+ Given I have a movies directory
86
+ And I have a movies/scifi directory
87
+ And I have a movies/scifi/_posts directory
88
+ And I have a _layouts directory
89
+ And I have the following post in "movies/scifi":
90
+ | title | date | layout | content |
91
+ | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
92
+ And I have a simple layout that contains "Post categories: {{ site.posts.first.categories | array_to_sentence_string }}"
93
+ When I run jekyll
94
+ Then the _site directory should exist
95
+ And I should see "Post categories: movies and scifi" in "_site/movies/scifi/2009/03/27/star-wars.html"
96
+
97
+ Scenario: Use post.categories variable when category is in YAML
98
+ Given I have a _posts directory
99
+ And I have a _layouts directory
100
+ And I have the following post:
101
+ | title | date | layout | category | content |
102
+ | Star Wars | 3/27/2009 | simple | movies | Luke, I am your father. |
103
+ And I have a simple layout that contains "Post category: {{ site.posts.first.categories }}"
104
+ When I run jekyll
105
+ Then the _site directory should exist
106
+ And I should see "Post category: movies" in "_site/movies/2009/03/27/star-wars.html"
107
+
108
+ Scenario: Use post.categories variable when categories are in YAML
109
+ Given I have a _posts directory
110
+ And I have a _layouts directory
111
+ And I have the following post:
112
+ | title | date | layout | categories | content |
113
+ | Star Wars | 3/27/2009 | simple | ['movies', 'scifi'] | Luke, I am your father. |
114
+ And I have a simple layout that contains "Post categories: {{ site.posts.first.categories | array_to_sentence_string }}"
115
+ When I run jekyll
116
+ Then the _site directory should exist
117
+ And I should see "Post categories: movies and scifi" in "_site/movies/scifi/2009/03/27/star-wars.html"
118
+
119
+ Scenario: Disable a post from being published
120
+ Given I have a _posts directory
121
+ And I have an "index.html" file that contains "Published!"
122
+ And I have the following post:
123
+ | title | date | layout | published | content |
124
+ | Star Wars | 3/27/2009 | simple | false | Luke, I am your father. |
125
+ When I run jekyll
126
+ Then the _site directory should exist
127
+ And the "_site/2009/03/27/star-wars.html" file should not exist
128
+ And I should see "Published!" in "_site/index.html"
129
+
130
+ Scenario: Use a custom variable
131
+ Given I have a _posts directory
132
+ And I have a _layouts directory
133
+ And I have the following post:
134
+ | title | date | layout | author | content |
135
+ | Star Wars | 3/27/2009 | simple | Darth Vader | Luke, I am your father. |
136
+ And I have a simple layout that contains "Post author: {{ site.posts.first.author }}"
137
+ When I run jekyll
138
+ Then the _site directory should exist
139
+ And I should see "Post author: Darth Vader" in "_site/2009/03/27/star-wars.html"
140
+
141
+ Scenario: Previous and next posts title
142
+ Given I have a _posts directory
143
+ And I have a _layouts directory
144
+ And I have the following posts:
145
+ | title | date | layout | author | content |
146
+ | Star Wars | 3/27/2009 | ordered | Darth Vader | Luke, I am your father. |
147
+ | Some like it hot | 4/27/2009 | ordered | Osgood | Nobody is perfect. |
148
+ | Terminator | 5/27/2009 | ordered | Arnold | Sayonara, baby |
149
+ And I have a ordered layout that contains "Previous post: {{ page.previous.title }} and next post: {{ page.next.title }}"
150
+ When I run jekyll
151
+ Then the _site directory should exist
152
+ And I should see "next post: Some like it hot" in "_site/2009/03/27/star-wars.html"
153
+ And I should see "Previous post: Some like it hot" in "_site/2009/05/27/terminator.html"
@@ -0,0 +1,63 @@
1
+ Feature: Site configuration
2
+ As a hacker who likes to blog
3
+ I want to be able to configure jekyll
4
+ In order to make setting up a site easier
5
+
6
+ Scenario: Change destination directory
7
+ Given I have a blank site in "_sourcedir"
8
+ And I have an "_sourcedir/index.html" file that contains "Changing source directory"
9
+ And I have a configuration file with "source" set to "_sourcedir"
10
+ When I run jekyll
11
+ Then the _site directory should exist
12
+ And I should see "Changing source directory" in "_site/index.html"
13
+
14
+ Scenario: Change destination directory
15
+ Given I have an "index.html" file that contains "Changing destination directory"
16
+ And I have a configuration file with "destination" set to "_mysite"
17
+ When I run jekyll
18
+ Then the _mysite directory should exist
19
+ And I should see "Changing destination directory" in "_mysite/index.html"
20
+
21
+ Scenario: Exclude files inline
22
+ Given I have an "Rakefile" file that contains "I want to be excluded"
23
+ And I have an "README" file that contains "I want to be excluded"
24
+ And I have an "index.html" file that contains "I want to be included"
25
+ And I have a configuration file with "exclude" set to "Rakefile", "README"
26
+ When I run jekyll
27
+ Then I should see "I want to be included" in "_site/index.html"
28
+ And the "_site/Rakefile" file should not exist
29
+ And the "_site/README" file should not exist
30
+
31
+ Scenario: Exclude files with YAML array
32
+ Given I have an "Rakefile" file that contains "I want to be excluded"
33
+ And I have an "README" file that contains "I want to be excluded"
34
+ And I have an "index.html" file that contains "I want to be included"
35
+ And I have a configuration file with "exclude" set to:
36
+ | Value |
37
+ | README |
38
+ | Rakefile |
39
+ When I run jekyll
40
+ Then I should see "I want to be included" in "_site/index.html"
41
+ And the "_site/Rakefile" file should not exist
42
+ And the "_site/README" file should not exist
43
+
44
+ Scenario: Use RDiscount for markup
45
+ Given I have an "index.markdown" page that contains "[Google](http://google.com)"
46
+ And I have a configuration file with "markdown" set to "rdiscount"
47
+ When I run jekyll
48
+ Then the _site directory should exist
49
+ And I should see "<a href="http://google.com">Google</a>" in "_site/index.html"
50
+
51
+ Scenario: Use Maruku for markup
52
+ Given I have an "index.markdown" page that contains "[Google](http://google.com)"
53
+ And I have a configuration file with "markdown" set to "maruku"
54
+ When I run jekyll
55
+ Then the _site directory should exist
56
+ And I should see "<a href='http://google.com'>Google</a>" in "_site/index.html"
57
+
58
+ Scenario: Highlight code with pygments
59
+ Given I have an "index.html" file that contains "{% highlight ruby %} puts 'Hello world!' {% endhighlight %}"
60
+ And I have a configuration file with "pygments" set to "true"
61
+ When I run jekyll
62
+ Then the _site directory should exist
63
+ And I should see "puts 'Hello world!'" in "_site/index.html"
@@ -0,0 +1,82 @@
1
+ Feature: Site data
2
+ As a hacker who likes to blog
3
+ I want to be able to embed data into my site
4
+ In order to make the site slightly dynamic
5
+
6
+ Scenario: Use page variable in a page
7
+ Given I have an "contact.html" page with title "Contact" that contains "{{ page.title }}: email@me.com"
8
+ When I run jekyll
9
+ Then the _site directory should exist
10
+ And I should see "Contact: email@me.com" in "_site/contact.html"
11
+
12
+ Scenario: Use site.time variable
13
+ Given I have an "index.html" page that contains "{{ site.time }}"
14
+ When I run jekyll
15
+ Then the _site directory should exist
16
+ And I should see today's time in "_site/index.html"
17
+
18
+ Scenario: Use site.posts variable for latest post
19
+ Given I have a _posts directory
20
+ And I have an "index.html" page that contains "{{ site.posts.first.title }}: {{ site.posts.first.url }}"
21
+ And I have the following posts:
22
+ | title | date | content |
23
+ | First Post | 3/25/2009 | My First Post |
24
+ | Second Post | 3/26/2009 | My Second Post |
25
+ | Third Post | 3/27/2009 | My Third Post |
26
+ When I run jekyll
27
+ Then the _site directory should exist
28
+ And I should see "Third Post: /2009/03/27/third-post.html" in "_site/index.html"
29
+
30
+ Scenario: Use site.posts variable in a loop
31
+ Given I have a _posts directory
32
+ And I have an "index.html" page that contains "{% for post in site.posts %} {{ post.title }} {% endfor %}"
33
+ And I have the following posts:
34
+ | title | date | content |
35
+ | First Post | 3/25/2009 | My First Post |
36
+ | Second Post | 3/26/2009 | My Second Post |
37
+ | Third Post | 3/27/2009 | My Third Post |
38
+ When I run jekyll
39
+ Then the _site directory should exist
40
+ And I should see "Third Post Second Post First Post" in "_site/index.html"
41
+
42
+ Scenario: Use site.categories.code variable
43
+ Given I have a _posts directory
44
+ And I have an "index.html" page that contains "{% for post in site.categories.code %} {{ post.title }} {% endfor %}"
45
+ And I have the following posts:
46
+ | title | date | category | content |
47
+ | Awesome Hack | 3/26/2009 | code | puts 'Hello World' |
48
+ | Delicious Beer | 3/26/2009 | food | 1) Yuengling |
49
+ When I run jekyll
50
+ Then the _site directory should exist
51
+ And I should see "Awesome Hack" in "_site/index.html"
52
+
53
+ Scenario: Use site.tags variable
54
+ Given I have a _posts directory
55
+ And I have an "index.html" page that contains "{% for post in site.tags.beer %} {{ post.content }} {% endfor %}"
56
+ And I have the following posts:
57
+ | title | date | tag | content |
58
+ | Delicious Beer | 3/26/2009 | beer | 1) Yuengling |
59
+ When I run jekyll
60
+ Then the _site directory should exist
61
+ And I should see "Yuengling" in "_site/index.html"
62
+
63
+ Scenario: Order Posts by name when on the same date
64
+ Given I have a _posts directory
65
+ And I have an "index.html" page that contains "{% for post in site.posts %}{{ post.title }}:{{ post.previous.title}},{{ post.next.title}} {% endfor %}"
66
+ And I have the following posts:
67
+ | title | date | content |
68
+ | first | 2/26/2009 | first |
69
+ | A | 3/26/2009 | A |
70
+ | B | 3/26/2009 | B |
71
+ | C | 3/26/2009 | C |
72
+ | last | 4/26/2009 | last |
73
+ When I run jekyll
74
+ Then the _site directory should exist
75
+ And I should see "last:C, C:B,last B:A,C A:first,B first:,A" in "_site/index.html"
76
+
77
+ Scenario: Use configuration date in site payload
78
+ Given I have an "index.html" page that contains "{{ site.url }}"
79
+ And I have a configuration file with "url" set to "http://mysite.com"
80
+ When I run jekyll
81
+ Then the _site directory should exist
82
+ And I should see "http://mysite.com" in "_site/index.html"
@@ -0,0 +1,136 @@
1
+ Before do
2
+ FileUtils.mkdir(TEST_DIR)
3
+ Dir.chdir(TEST_DIR)
4
+ end
5
+
6
+ After do
7
+ Dir.chdir(TEST_DIR)
8
+ FileUtils.rm_rf(TEST_DIR)
9
+ end
10
+
11
+ Given /^I have a blank site in "(.*)"$/ do |path|
12
+ FileUtils.mkdir(path)
13
+ end
14
+
15
+ # Like "I have a foo file" but gives a yaml front matter so jekyll actually processes it
16
+ Given /^I have an "(.*)" page(?: with (.*) "(.*)")? that contains "(.*)"$/ do |file, key, value, text|
17
+ File.open(file, 'w') do |f|
18
+ f.write <<EOF
19
+ ---
20
+ #{key || 'layout'}: #{value || 'nil'}
21
+ ---
22
+ #{text}
23
+ EOF
24
+ f.close
25
+ end
26
+ end
27
+
28
+ Given /^I have an "(.*)" file that contains "(.*)"$/ do |file, text|
29
+ File.open(file, 'w') do |f|
30
+ f.write(text)
31
+ f.close
32
+ end
33
+ end
34
+
35
+ Given /^I have a (.*) layout that contains "(.*)"$/ do |layout, text|
36
+ File.open(File.join('_layouts', layout + '.html'), 'w') do |f|
37
+ f.write(text)
38
+ f.close
39
+ end
40
+ end
41
+
42
+ Given /^I have a (.*) directory$/ do |dir|
43
+ FileUtils.mkdir(dir)
44
+ end
45
+
46
+ Given /^I have the following posts?(?: (.*) "(.*)")?:$/ do |direction, folder, table|
47
+ table.hashes.each do |post|
48
+ date = Date.parse(post['date']).strftime('%Y-%m-%d')
49
+ title = post['title'].downcase.gsub(/[^\w]/, " ").strip.gsub(/\s+/, '-')
50
+
51
+ if direction && direction == "in"
52
+ before = folder || '.'
53
+ elsif direction && direction == "under"
54
+ after = folder || '.'
55
+ end
56
+
57
+ path = File.join(before || '.', '_posts', after || '.', "#{date}-#{title}.#{post['type'] || 'textile'}")
58
+
59
+ matter_hash = {}
60
+ %w(title layout tag tags category categories published author).each do |key|
61
+ matter_hash[key] = post[key] if post[key]
62
+ end
63
+ matter = matter_hash.map { |k, v| "#{k}: #{v}\n" }.join.chomp
64
+
65
+ content = post['content']
66
+ if post['input'] && post['filter']
67
+ content = "{{ #{post['input']} | #{post['filter']} }}"
68
+ end
69
+
70
+ File.open(path, 'w') do |f|
71
+ f.write <<EOF
72
+ ---
73
+ #{matter}
74
+ ---
75
+ #{content}
76
+ EOF
77
+ f.close
78
+ end
79
+ end
80
+ end
81
+
82
+ Given /^I have a configuration file with "(.*)" set to "(.*)"$/ do |key, value|
83
+ File.open('_config.yml', 'w') do |f|
84
+ f.write("#{key}: #{value}")
85
+ f.close
86
+ end
87
+ end
88
+
89
+ Given /^I have a configuration file with "([^\"]*)" set to:$/ do |key, table|
90
+ File.open('_config.yml', 'w') do |f|
91
+ f.write("#{key}:\n")
92
+ table.hashes.each do |row|
93
+ f.write("- #{row["Value"]}\n")
94
+ end
95
+ f.close
96
+ end
97
+ end
98
+
99
+
100
+ When /^I run jekyll$/ do
101
+ run_jekyll
102
+ end
103
+
104
+ When /^I debug jekyll$/ do
105
+ run_jekyll(:debug => true)
106
+ end
107
+
108
+ When /^I change "(.*)" to contain "(.*)"$/ do |file, text|
109
+ File.open(file, 'a') do |f|
110
+ f.write(text)
111
+ end
112
+ end
113
+
114
+ Then /^the (.*) directory should exist$/ do |dir|
115
+ assert File.directory?(dir)
116
+ end
117
+
118
+ Then /^the (.*) file should exist$/ do |file|
119
+ assert File.file?(file)
120
+ end
121
+
122
+ Then /^I should see "(.*)" in "(.*)"$/ do |text, file|
123
+ assert_match Regexp.new(text), File.open(file).readlines.join
124
+ end
125
+
126
+ Then /^the "(.*)" file should not exist$/ do |file|
127
+ assert !File.exists?(file)
128
+ end
129
+
130
+ Then /^I should see today's time in "(.*)"$/ do |file|
131
+ assert_match Regexp.new(Regexp.escape(Time.now.to_s)), File.open(file).readlines.join
132
+ end
133
+
134
+ Then /^I should see today's date in "(.*)"$/ do |file|
135
+ assert_match Regexp.new(Date.today.to_s), File.open(file).readlines.join
136
+ end
@@ -0,0 +1,16 @@
1
+ require 'fileutils'
2
+ require 'rr'
3
+ require 'test/unit'
4
+
5
+ World do
6
+ include Test::Unit::Assertions
7
+ end
8
+
9
+ TEST_DIR = File.join('/', 'tmp', 'jekyll')
10
+ JEKYLL_PATH = File.join(ENV['PWD'], 'bin', 'jekyll')
11
+
12
+ def run_jekyll(opts = {})
13
+ command = JEKYLL_PATH
14
+ command << " >> /dev/null 2>&1" if opts[:debug].nil?
15
+ system command
16
+ end
@@ -0,0 +1,136 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{mojombo-jekyll}
5
+ s.version = "0.5.4"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Tom Preston-Werner"]
9
+ s.date = %q{2009-08-24}
10
+ s.default_executable = %q{jekyll}
11
+ s.description = %q{Jekyll is a simple, blog aware, static site generator.}
12
+ s.email = %q{tom@mojombo.com}
13
+ s.executables = ["jekyll"]
14
+ s.extra_rdoc_files = [
15
+ "README.textile"
16
+ ]
17
+ s.files = [
18
+ ".gitignore",
19
+ "History.txt",
20
+ "README.textile",
21
+ "Rakefile",
22
+ "VERSION.yml",
23
+ "bin/jekyll",
24
+ "features/create_sites.feature",
25
+ "features/embed_filters.feature",
26
+ "features/pagination.feature",
27
+ "features/permalinks.feature",
28
+ "features/post_data.feature",
29
+ "features/site_configuration.feature",
30
+ "features/site_data.feature",
31
+ "features/step_definitions/jekyll_steps.rb",
32
+ "features/support/env.rb",
33
+ "jekyll.gemspec",
34
+ "lib/jekyll.rb",
35
+ "lib/jekyll/albino.rb",
36
+ "lib/jekyll/converters/csv.rb",
37
+ "lib/jekyll/converters/mephisto.rb",
38
+ "lib/jekyll/converters/mt.rb",
39
+ "lib/jekyll/converters/textpattern.rb",
40
+ "lib/jekyll/converters/typo.rb",
41
+ "lib/jekyll/converters/wordpress.rb",
42
+ "lib/jekyll/convertible.rb",
43
+ "lib/jekyll/core_ext.rb",
44
+ "lib/jekyll/filters.rb",
45
+ "lib/jekyll/layout.rb",
46
+ "lib/jekyll/page.rb",
47
+ "lib/jekyll/pager.rb",
48
+ "lib/jekyll/post.rb",
49
+ "lib/jekyll/site.rb",
50
+ "lib/jekyll/tags/highlight.rb",
51
+ "lib/jekyll/tags/include.rb",
52
+ "test/helper.rb",
53
+ "test/source/_includes/sig.markdown",
54
+ "test/source/_layouts/default.html",
55
+ "test/source/_layouts/simple.html",
56
+ "test/source/_posts/2008-02-02-not-published.textile",
57
+ "test/source/_posts/2008-02-02-published.textile",
58
+ "test/source/_posts/2008-10-18-foo-bar.textile",
59
+ "test/source/_posts/2008-11-21-complex.textile",
60
+ "test/source/_posts/2008-12-03-permalinked-post.textile",
61
+ "test/source/_posts/2008-12-13-include.markdown",
62
+ "test/source/_posts/2009-01-27-array-categories.textile",
63
+ "test/source/_posts/2009-01-27-categories.textile",
64
+ "test/source/_posts/2009-01-27-category.textile",
65
+ "test/source/_posts/2009-03-12-hash-#1.markdown",
66
+ "test/source/_posts/2009-05-18-tag.textile",
67
+ "test/source/_posts/2009-05-18-tags.textile",
68
+ "test/source/_posts/2009-06-22-empty-yaml.textile",
69
+ "test/source/_posts/2009-06-22-no-yaml.textile",
70
+ "test/source/about.html",
71
+ "test/source/category/_posts/2008-9-23-categories.textile",
72
+ "test/source/contacts.html",
73
+ "test/source/css/screen.css",
74
+ "test/source/foo/_posts/bar/2008-12-12-topical-post.textile",
75
+ "test/source/index.html",
76
+ "test/source/sitemap.xml",
77
+ "test/source/win/_posts/2009-05-24-yaml-linebreak.markdown",
78
+ "test/source/z_category/_posts/2008-9-23-categories.textile",
79
+ "test/suite.rb",
80
+ "test/test_configuration.rb",
81
+ "test/test_filters.rb",
82
+ "test/test_generated_site.rb",
83
+ "test/test_page.rb",
84
+ "test/test_pager.rb",
85
+ "test/test_post.rb",
86
+ "test/test_site.rb",
87
+ "test/test_tags.rb"
88
+ ]
89
+ s.homepage = %q{http://github.com/mojombo/jekyll}
90
+ s.rdoc_options = ["--charset=UTF-8"]
91
+ s.require_paths = ["lib"]
92
+ s.rubyforge_project = %q{jekyll}
93
+ s.rubygems_version = %q{1.3.5}
94
+ s.summary = %q{Jekyll is a simple, blog aware, static site generator.}
95
+ s.test_files = [
96
+ "test/helper.rb",
97
+ "test/suite.rb",
98
+ "test/test_configuration.rb",
99
+ "test/test_filters.rb",
100
+ "test/test_generated_site.rb",
101
+ "test/test_page.rb",
102
+ "test/test_pager.rb",
103
+ "test/test_post.rb",
104
+ "test/test_site.rb",
105
+ "test/test_tags.rb"
106
+ ]
107
+
108
+ if s.respond_to? :specification_version then
109
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
110
+ s.specification_version = 3
111
+
112
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
113
+ s.add_runtime_dependency(%q<RedCloth>, [">= 4.2.1"])
114
+ s.add_runtime_dependency(%q<liquid>, [">= 1.9.0"])
115
+ s.add_runtime_dependency(%q<classifier>, [">= 1.3.1"])
116
+ s.add_runtime_dependency(%q<maruku>, [">= 0.5.9"])
117
+ s.add_runtime_dependency(%q<directory_watcher>, [">= 1.1.1"])
118
+ s.add_runtime_dependency(%q<open4>, [">= 0.9.6"])
119
+ else
120
+ s.add_dependency(%q<RedCloth>, [">= 4.2.1"])
121
+ s.add_dependency(%q<liquid>, [">= 1.9.0"])
122
+ s.add_dependency(%q<classifier>, [">= 1.3.1"])
123
+ s.add_dependency(%q<maruku>, [">= 0.5.9"])
124
+ s.add_dependency(%q<directory_watcher>, [">= 1.1.1"])
125
+ s.add_dependency(%q<open4>, [">= 0.9.6"])
126
+ end
127
+ else
128
+ s.add_dependency(%q<RedCloth>, [">= 4.2.1"])
129
+ s.add_dependency(%q<liquid>, [">= 1.9.0"])
130
+ s.add_dependency(%q<classifier>, [">= 1.3.1"])
131
+ s.add_dependency(%q<maruku>, [">= 0.5.9"])
132
+ s.add_dependency(%q<directory_watcher>, [">= 1.1.1"])
133
+ s.add_dependency(%q<open4>, [">= 0.9.6"])
134
+ s.add_dependency(%q<evil>, [">= 0.0.1"])
135
+ end
136
+ end
@@ -169,7 +169,7 @@ module Jekyll
169
169
  base = File.join(self.source, dir)
170
170
  entries = filter_entries(Dir.entries(base))
171
171
  directories = entries.select { |e| File.directory?(File.join(base, e)) }
172
- files = entries.reject { |e| File.directory?(File.join(base, e)) }
172
+ files = entries.reject { |e| File.directory?(File.join(base, e)) || File.symlink?(File.join(base, e)) }
173
173
 
174
174
  # we need to make sure to process _posts *first* otherwise they
175
175
  # might not be available yet to other templates as {{ site.posts }}
@@ -177,7 +177,7 @@ module Jekyll
177
177
  directories.delete('_posts')
178
178
  read_posts(dir)
179
179
  end
180
-
180
+
181
181
  [directories, files].each do |entries|
182
182
  entries.each do |f|
183
183
  if File.directory?(File.join(base, f))
@@ -187,7 +187,6 @@ module Jekyll
187
187
  paginate_posts(f, dir)
188
188
  else
189
189
  first3 = File.open(File.join(self.source, dir, f)) { |fd| fd.read(3) }
190
-
191
190
  if first3 == "---"
192
191
  # file appears to have a YAML header so process it as a page
193
192
  page = Page.new(self, self.source, dir, f)
metadata CHANGED
@@ -1,91 +1,136 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: mojombo-jekyll
3
- version: !ruby/object:Gem::Version
4
- version: 0.5.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.4
5
+ prerelease:
5
6
  platform: ruby
6
- authors:
7
+ authors:
7
8
  - Tom Preston-Werner
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
-
12
- date: 2009-07-14 00:00:00 -07:00
13
- default_executable: jekyll
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2009-08-24 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: RedCloth
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 4.2.1
17
22
  type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
23
29
  version: 4.2.1
24
- version:
25
- - !ruby/object:Gem::Dependency
30
+ - !ruby/object:Gem::Dependency
26
31
  name: liquid
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: 1.9.0
27
38
  type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
33
45
  version: 1.9.0
34
- version:
35
- - !ruby/object:Gem::Dependency
46
+ - !ruby/object:Gem::Dependency
36
47
  name: classifier
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: 1.3.1
37
54
  type: :runtime
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
43
61
  version: 1.3.1
44
- version:
45
- - !ruby/object:Gem::Dependency
62
+ - !ruby/object:Gem::Dependency
46
63
  name: maruku
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: 0.5.9
47
70
  type: :runtime
48
- version_requirement:
49
- version_requirements: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
53
77
  version: 0.5.9
54
- version:
55
- - !ruby/object:Gem::Dependency
78
+ - !ruby/object:Gem::Dependency
56
79
  name: directory_watcher
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: 1.1.1
57
86
  type: :runtime
58
- version_requirement:
59
- version_requirements: !ruby/object:Gem::Requirement
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
63
93
  version: 1.1.1
64
- version:
65
- - !ruby/object:Gem::Dependency
94
+ - !ruby/object:Gem::Dependency
66
95
  name: open4
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: 0.9.6
67
102
  type: :runtime
68
- version_requirement:
69
- version_requirements: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
73
109
  version: 0.9.6
74
- version:
75
110
  description: Jekyll is a simple, blog aware, static site generator.
76
111
  email: tom@mojombo.com
77
- executables:
112
+ executables:
78
113
  - jekyll
79
114
  extensions: []
80
-
81
- extra_rdoc_files:
115
+ extra_rdoc_files:
82
116
  - README.textile
83
- files:
117
+ files:
118
+ - .gitignore
84
119
  - History.txt
85
120
  - README.textile
86
121
  - Rakefile
87
122
  - VERSION.yml
88
123
  - bin/jekyll
124
+ - features/create_sites.feature
125
+ - features/embed_filters.feature
126
+ - features/pagination.feature
127
+ - features/permalinks.feature
128
+ - features/post_data.feature
129
+ - features/site_configuration.feature
130
+ - features/site_data.feature
131
+ - features/step_definitions/jekyll_steps.rb
132
+ - features/support/env.rb
133
+ - jekyll.gemspec
89
134
  - lib/jekyll.rb
90
135
  - lib/jekyll/albino.rb
91
136
  - lib/jekyll/converters/csv.rb
@@ -140,40 +185,39 @@ files:
140
185
  - test/test_post.rb
141
186
  - test/test_site.rb
142
187
  - test/test_tags.rb
143
- has_rdoc: false
144
188
  homepage: http://github.com/mojombo/jekyll
189
+ licenses: []
145
190
  post_install_message:
146
- rdoc_options:
191
+ rdoc_options:
147
192
  - --charset=UTF-8
148
- require_paths:
193
+ require_paths:
149
194
  - lib
150
- required_ruby_version: !ruby/object:Gem::Requirement
151
- requirements:
152
- - - ">="
153
- - !ruby/object:Gem::Version
154
- version: "0"
155
- version:
156
- required_rubygems_version: !ruby/object:Gem::Requirement
157
- requirements:
158
- - - ">="
159
- - !ruby/object:Gem::Version
160
- version: "0"
161
- version:
195
+ required_ruby_version: !ruby/object:Gem::Requirement
196
+ none: false
197
+ requirements:
198
+ - - ! '>='
199
+ - !ruby/object:Gem::Version
200
+ version: '0'
201
+ required_rubygems_version: !ruby/object:Gem::Requirement
202
+ none: false
203
+ requirements:
204
+ - - ! '>='
205
+ - !ruby/object:Gem::Version
206
+ version: '0'
162
207
  requirements: []
163
-
164
208
  rubyforge_project: jekyll
165
- rubygems_version: 1.2.0
209
+ rubygems_version: 1.8.24
166
210
  signing_key:
167
211
  specification_version: 3
168
212
  summary: Jekyll is a simple, blog aware, static site generator.
169
- test_files:
170
- - test/test_page.rb
171
- - test/test_post.rb
172
- - test/test_pager.rb
173
- - test/test_configuration.rb
174
- - test/test_tags.rb
175
- - test/test_generated_site.rb
213
+ test_files:
214
+ - test/helper.rb
176
215
  - test/suite.rb
216
+ - test/test_configuration.rb
177
217
  - test/test_filters.rb
178
- - test/helper.rb
218
+ - test/test_generated_site.rb
219
+ - test/test_page.rb
220
+ - test/test_pager.rb
221
+ - test/test_post.rb
179
222
  - test/test_site.rb
223
+ - test/test_tags.rb