mojombo-jekyll 0.5.1 → 0.5.2

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,4 +1,20 @@
1
- == 0.5.1
1
+ == 0.5.2 / 2009-06-24
2
+ * Enhancements
3
+ * Added --paginate option to the executable along with a paginator object for the payload [github.com/calavera]
4
+ * Upgraded RedCloth to 4.2.1, which makes <notextile> tags work once again.
5
+ * Configuration options set in config.yml are now available through the site payload [github.com/vilcans]
6
+ * Posts can now have an empty YAML front matter or none at all [github.com/bahuvrihi]
7
+ * Bug Fixes
8
+ * Fixing Ruby 1.9 issue that requires to_s on the err object [github.com/Chrononaut]
9
+ * Fixes for pagination and ordering posts on the same day [github.com/ujh]
10
+ * Made pages respect permalinks style and permalinks in yml front matter [github.com/eugenebolshakov]
11
+ * Index.html file should always have index.html permalink [github.com/eugenebolshakov]
12
+ * Added trailing slash to pretty permalink style so Apache is happy [github.com/eugenebolshakov]
13
+ * Bad markdown processor in config fails sooner and with better message [github.com/gcnovus]
14
+ * Allow CRLFs in yaml frontmatter [github.com/juretta]
15
+ * Added Date#xmlschema for Ruby versions < 1.9
16
+
17
+ == 0.5.1 / 2009-05-06
2
18
  * Major Enhancements
3
19
  * Next/previous posts in site payload [github.com/pantulis, github.com/tomo]
4
20
  * Permalink templating system
@@ -10,6 +10,7 @@ h2. Getting Started
10
10
  * Read up about its "Usage":http://wiki.github.com/mojombo/jekyll/usage and "Configuration":http://wiki.github.com/mojombo/jekyll/configuration
11
11
  * Take a gander at some existing "Sites":http://wiki.github.com/mojombo/jekyll/sites
12
12
  * Fork and "Contribute":http://wiki.github.com/mojombo/jekyll/contribute your own modifications
13
+ * Have questions? Post them on the "Mailing List":http://groups.google.com/group/jekyll-rb
13
14
 
14
15
  h2. Diving In
15
16
 
@@ -21,7 +22,7 @@ h2. Diving In
21
22
 
22
23
  h2. Dependencies
23
24
 
24
- * RedCloth 4.1.0: Textile support. This version obeys <notextile> tags. The latest version will still work, but tests will fail.
25
+ * RedCloth: Textile support
25
26
  * Liquid: Templating system
26
27
  * Classifier: Generating related posts
27
28
  * Maruku: Default markdown engine
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ begin
15
15
  s.rubyforge_project = "jekyll"
16
16
  s.files.exclude 'test/dest'
17
17
  s.test_files.exclude 'test/dest'
18
- s.add_dependency('RedCloth', '= 4.1.0')
18
+ s.add_dependency('RedCloth', '>= 4.2.1')
19
19
  s.add_dependency('liquid', '>= 1.9.0')
20
20
  s.add_dependency('classifier', '>= 1.3.1')
21
21
  s.add_dependency('maruku', '>= 0.5.9')
@@ -81,7 +81,7 @@ begin
81
81
  require 'cucumber/rake/task'
82
82
 
83
83
  Cucumber::Rake::Task.new(:features) do |t|
84
- t.cucumber_opts = "--format pretty"
84
+ t.cucumber_opts = "--format progress"
85
85
  end
86
86
  rescue LoadError
87
87
  desc 'Cucumber rake task not available'
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 5
4
- :patch: 1
4
+ :patch: 2
data/bin/jekyll CHANGED
@@ -51,6 +51,16 @@ opts = OptionParser.new do |opts|
51
51
  opts.on("--permalink [TYPE]", "Use 'date' (default) for YYYY/MM/DD") do |style|
52
52
  options['permalink'] = style unless style.nil?
53
53
  end
54
+
55
+ opts.on("--paginate [POSTS_PER_PAGE]", "Paginate a blog's posts") do |per_page|
56
+ begin
57
+ options['paginate'] = per_page.to_i
58
+ raise ArgumentError if options['paginate'] == 0
59
+ rescue
60
+ puts 'you must specify a number of posts by page bigger than 0'
61
+ exit 0
62
+ end
63
+ end
54
64
 
55
65
  opts.on("--version", "Display current version") do
56
66
  puts "Jekyll " + Jekyll.version
@@ -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,63 @@
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 a configuration file with "permalink" set to "pretty"
30
+ When I run jekyll
31
+ Then the _site directory should exist
32
+ And I should see "Totally index" in "_site/index.html"
33
+ And I should see "Totally awesome" in "_site/awesome/index.html"
34
+
35
+ Scenario: Use custom permalink schema with prefix
36
+ Given I have a _posts directory
37
+ And I have the following post:
38
+ | title | category | date | content |
39
+ | Custom Permalink Schema | stuff | 3/27/2009 | Totally custom. |
40
+ And I have a configuration file with "permalink" set to "/blog/:year/:month/:day/:title"
41
+ When I run jekyll
42
+ Then the _site directory should exist
43
+ And I should see "Totally custom." in "_site/blog/2009/03/27/custom-permalink-schema/index.html"
44
+
45
+ Scenario: Use custom permalink schema with category
46
+ Given I have a _posts directory
47
+ And I have the following post:
48
+ | title | category | date | content |
49
+ | Custom Permalink Schema | stuff | 3/27/2009 | Totally custom. |
50
+ And I have a configuration file with "permalink" set to "/:categories/:title.html"
51
+ When I run jekyll
52
+ Then the _site directory should exist
53
+ And I should see "Totally custom." in "_site/stuff/custom-permalink-schema.html"
54
+
55
+ Scenario: Use custom permalink schema with squished date
56
+ Given I have a _posts directory
57
+ And I have the following post:
58
+ | title | category | date | content |
59
+ | Custom Permalink Schema | stuff | 3/27/2009 | Totally custom. |
60
+ And I have a configuration file with "permalink" set to "/:month-:day-:year/:title.html"
61
+ When I run jekyll
62
+ Then the _site directory should exist
63
+ 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"