fagiani-jekyll 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +284 -0
- data/LICENSE +21 -0
- data/README.textile +41 -0
- data/Rakefile +159 -0
- data/bin/jekyll +192 -0
- data/cucumber.yml +1 -0
- data/features/create_sites.feature +94 -0
- data/features/embed_filters.feature +60 -0
- data/features/markdown.feature +30 -0
- data/features/pagination.feature +27 -0
- data/features/permalinks.feature +65 -0
- data/features/post_data.feature +153 -0
- data/features/site_configuration.feature +126 -0
- data/features/site_data.feature +82 -0
- data/features/step_definitions/jekyll_steps.rb +145 -0
- data/features/support/env.rb +16 -0
- data/jekyll.gemspec +140 -0
- data/lib/jekyll.rb +125 -0
- data/lib/jekyll/albino.rb +120 -0
- data/lib/jekyll/converter.rb +50 -0
- data/lib/jekyll/converters/identity.rb +22 -0
- data/lib/jekyll/converters/markdown.rb +113 -0
- data/lib/jekyll/converters/textile.rb +33 -0
- data/lib/jekyll/convertible.rb +98 -0
- data/lib/jekyll/core_ext.rb +52 -0
- data/lib/jekyll/errors.rb +6 -0
- data/lib/jekyll/filters.rb +53 -0
- data/lib/jekyll/generator.rb +7 -0
- data/lib/jekyll/generators/pagination.rb +87 -0
- data/lib/jekyll/layout.rb +36 -0
- data/lib/jekyll/migrators/csv.rb +26 -0
- data/lib/jekyll/migrators/drupal.rb +86 -0
- data/lib/jekyll/migrators/marley.rb +53 -0
- data/lib/jekyll/migrators/mephisto.rb +79 -0
- data/lib/jekyll/migrators/mt.rb +77 -0
- data/lib/jekyll/migrators/textpattern.rb +50 -0
- data/lib/jekyll/migrators/typo.rb +49 -0
- data/lib/jekyll/migrators/wordpress.com.rb +38 -0
- data/lib/jekyll/migrators/wordpress.rb +56 -0
- data/lib/jekyll/page.rb +134 -0
- data/lib/jekyll/plugin.rb +76 -0
- data/lib/jekyll/post.rb +244 -0
- data/lib/jekyll/site.rb +273 -0
- data/lib/jekyll/static_file.rb +75 -0
- data/lib/jekyll/tags/highlight.rb +73 -0
- data/lib/jekyll/tags/include.rb +37 -0
- data/test/helper.rb +34 -0
- data/test/source/.htaccess +8 -0
- data/test/source/_includes/sig.markdown +3 -0
- data/test/source/_layouts/default.html +27 -0
- data/test/source/_layouts/simple.html +1 -0
- data/test/source/_posts/2008-02-02-not-published.textile +8 -0
- data/test/source/_posts/2008-02-02-published.textile +8 -0
- data/test/source/_posts/2008-10-18-foo-bar.textile +8 -0
- data/test/source/_posts/2008-11-21-complex.textile +8 -0
- data/test/source/_posts/2008-12-03-permalinked-post.textile +9 -0
- data/test/source/_posts/2008-12-13-include.markdown +8 -0
- data/test/source/_posts/2009-01-27-array-categories.textile +10 -0
- data/test/source/_posts/2009-01-27-categories.textile +7 -0
- data/test/source/_posts/2009-01-27-category.textile +7 -0
- data/test/source/_posts/2009-01-27-empty-categories.textile +7 -0
- data/test/source/_posts/2009-01-27-empty-category.textile +7 -0
- data/test/source/_posts/2009-03-12-hash-#1.markdown +6 -0
- data/test/source/_posts/2009-05-18-empty-tag.textile +6 -0
- data/test/source/_posts/2009-05-18-empty-tags.textile +6 -0
- data/test/source/_posts/2009-05-18-tag.textile +6 -0
- data/test/source/_posts/2009-05-18-tags.textile +9 -0
- data/test/source/_posts/2009-06-22-empty-yaml.textile +3 -0
- data/test/source/_posts/2009-06-22-no-yaml.textile +1 -0
- data/test/source/_posts/2010-01-08-triple-dash.markdown +5 -0
- data/test/source/_posts/2010-01-09-date-override.textile +7 -0
- data/test/source/_posts/2010-01-09-time-override.textile +7 -0
- data/test/source/_posts/2010-01-09-timezone-override.textile +7 -0
- data/test/source/_posts/2010-01-16-override-data.textile +4 -0
- data/test/source/about.html +6 -0
- data/test/source/category/_posts/2008-9-23-categories.textile +6 -0
- data/test/source/contacts.html +5 -0
- data/test/source/css/screen.css +76 -0
- data/test/source/deal.with.dots.html +7 -0
- data/test/source/foo/_posts/bar/2008-12-12-topical-post.textile +8 -0
- data/test/source/index.html +22 -0
- data/test/source/sitemap.xml +32 -0
- data/test/source/win/_posts/2009-05-24-yaml-linebreak.markdown +7 -0
- data/test/source/z_category/_posts/2008-9-23-categories.textile +6 -0
- data/test/suite.rb +9 -0
- data/test/test_configuration.rb +29 -0
- data/test/test_core_ext.rb +66 -0
- data/test/test_filters.rb +53 -0
- data/test/test_generated_site.rb +72 -0
- data/test/test_kramdown.rb +23 -0
- data/test/test_page.rb +117 -0
- data/test/test_pager.rb +113 -0
- data/test/test_post.rb +396 -0
- data/test/test_rdiscount.rb +18 -0
- data/test/test_site.rb +186 -0
- data/test/test_tags.rb +127 -0
- metadata +332 -0
data/bin/jekyll
ADDED
@@ -0,0 +1,192 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
4
|
+
|
5
|
+
help = <<HELP
|
6
|
+
Jekyll is a blog-aware, static site generator.
|
7
|
+
|
8
|
+
Basic Command Line Usage:
|
9
|
+
jekyll # . -> ./_site
|
10
|
+
jekyll <path to write generated site> # . -> <path>
|
11
|
+
jekyll <path to source> <path to write generated site> # <path> -> <path>
|
12
|
+
|
13
|
+
Configuration is read from '<source>/_config.yml' but can be overriden
|
14
|
+
using the following options:
|
15
|
+
|
16
|
+
HELP
|
17
|
+
|
18
|
+
require 'optparse'
|
19
|
+
require 'jekyll'
|
20
|
+
|
21
|
+
exec = {}
|
22
|
+
options = {}
|
23
|
+
opts = OptionParser.new do |opts|
|
24
|
+
opts.banner = help
|
25
|
+
|
26
|
+
opts.on("--[no-]safe", "Safe mode (default unsafe)") do |safe|
|
27
|
+
options['safe'] = safe
|
28
|
+
end
|
29
|
+
|
30
|
+
opts.on("--[no-]auto", "Auto-regenerate") do |auto|
|
31
|
+
options['auto'] = auto
|
32
|
+
end
|
33
|
+
|
34
|
+
opts.on("--server [PORT]", "Start web server (default port 4000)") do |port|
|
35
|
+
options['server'] = true
|
36
|
+
options['server_port'] = port unless port.nil?
|
37
|
+
end
|
38
|
+
|
39
|
+
opts.on("--no-server", "Do not start a web server") do |part|
|
40
|
+
options['server'] = false
|
41
|
+
end
|
42
|
+
|
43
|
+
opts.on("--base-url [BASE_URL]", "Serve website from a given base URL (default '/'") do |baseurl|
|
44
|
+
options['baseurl'] = baseurl
|
45
|
+
end
|
46
|
+
|
47
|
+
opts.on("--[no-]lsi", "Use LSI for better related posts") do |lsi|
|
48
|
+
options['lsi'] = lsi
|
49
|
+
end
|
50
|
+
|
51
|
+
opts.on("--[no-]pygments", "Use pygments to highlight code") do |pygments|
|
52
|
+
options['pygments'] = pygments
|
53
|
+
end
|
54
|
+
|
55
|
+
opts.on("--rdiscount", "Use rdiscount gem for Markdown") do
|
56
|
+
options['markdown'] = 'rdiscount'
|
57
|
+
end
|
58
|
+
|
59
|
+
opts.on("--kramdown", "Use kramdown gem for Markdown") do
|
60
|
+
options['markdown'] = 'kramdown'
|
61
|
+
end
|
62
|
+
|
63
|
+
opts.on("--time [TIME]", "Time to generate the site for") do |time|
|
64
|
+
options['time'] = Time.parse(time)
|
65
|
+
end
|
66
|
+
|
67
|
+
opts.on("--[no-]future", "Render future dated posts") do |future|
|
68
|
+
options['future'] = future
|
69
|
+
end
|
70
|
+
|
71
|
+
opts.on("--permalink [TYPE]", "Use 'date' (default) for YYYY/MM/DD") do |style|
|
72
|
+
options['permalink'] = style unless style.nil?
|
73
|
+
end
|
74
|
+
|
75
|
+
opts.on("--paginate [POSTS_PER_PAGE]", "Paginate a blog's posts") do |per_page|
|
76
|
+
begin
|
77
|
+
options['paginate'] = per_page.to_i
|
78
|
+
raise ArgumentError if options['paginate'] == 0
|
79
|
+
rescue
|
80
|
+
puts 'you must specify a number of posts by page bigger than 0'
|
81
|
+
exit 0
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
opts.on("--limit_posts [MAX_POSTS]", "Limit the number of posts to publish") do |limit_posts|
|
86
|
+
begin
|
87
|
+
options['limit_posts'] = limit_posts.to_i
|
88
|
+
raise ArgumentError if options['limit_posts'] < 1
|
89
|
+
rescue
|
90
|
+
puts 'you must specify a number of posts by page bigger than 0'
|
91
|
+
exit 0
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
opts.on("--url [URL]", "Set custom site.url") do |url|
|
96
|
+
options['url'] = url
|
97
|
+
end
|
98
|
+
|
99
|
+
opts.on("--version", "Display current version") do
|
100
|
+
puts "Jekyll " + Jekyll::VERSION
|
101
|
+
exit 0
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
# Read command line options into `options` hash
|
106
|
+
opts.parse!
|
107
|
+
|
108
|
+
# Get source and destintation from command line
|
109
|
+
case ARGV.size
|
110
|
+
when 0
|
111
|
+
when 1
|
112
|
+
options['destination'] = ARGV[0]
|
113
|
+
when 2
|
114
|
+
options['source'] = ARGV[0]
|
115
|
+
options['destination'] = ARGV[1]
|
116
|
+
else
|
117
|
+
puts "Invalid options. Run `jekyll --help` for assistance."
|
118
|
+
exit(1)
|
119
|
+
end
|
120
|
+
|
121
|
+
options = Jekyll.configuration(options)
|
122
|
+
|
123
|
+
# Get source and destination directories (possibly set by config file)
|
124
|
+
source = options['source']
|
125
|
+
destination = options['destination']
|
126
|
+
|
127
|
+
# Files to watch
|
128
|
+
def globs(source)
|
129
|
+
Dir.chdir(source) do
|
130
|
+
dirs = Dir['*'].select { |x| File.directory?(x) }
|
131
|
+
dirs -= ['_site']
|
132
|
+
dirs = dirs.map { |x| "#{x}/**/*" }
|
133
|
+
dirs += ['*']
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
# Create the Site
|
138
|
+
site = Jekyll::Site.new(options)
|
139
|
+
|
140
|
+
# Run the directory watcher for auto-generation, if required
|
141
|
+
if options['auto']
|
142
|
+
require 'directory_watcher'
|
143
|
+
|
144
|
+
puts "Auto-regenerating enabled: #{source} -> #{destination}"
|
145
|
+
|
146
|
+
dw = DirectoryWatcher.new(source)
|
147
|
+
dw.interval = 1
|
148
|
+
dw.glob = globs(source)
|
149
|
+
|
150
|
+
dw.add_observer do |*args|
|
151
|
+
t = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
152
|
+
puts "[#{t}] regeneration: #{args.size} files changed"
|
153
|
+
site.process
|
154
|
+
end
|
155
|
+
|
156
|
+
dw.start
|
157
|
+
|
158
|
+
unless options['server']
|
159
|
+
loop { sleep 1000 }
|
160
|
+
end
|
161
|
+
else
|
162
|
+
puts "Building site: #{source} -> #{destination}"
|
163
|
+
begin
|
164
|
+
site.process
|
165
|
+
rescue Jekyll::FatalException
|
166
|
+
exit(1)
|
167
|
+
end
|
168
|
+
puts "Successfully generated site: #{source} -> #{destination}"
|
169
|
+
end
|
170
|
+
|
171
|
+
# Run the server on the specified port, if required
|
172
|
+
if options['server']
|
173
|
+
require 'webrick'
|
174
|
+
include WEBrick
|
175
|
+
|
176
|
+
FileUtils.mkdir_p(destination)
|
177
|
+
|
178
|
+
mime_types = WEBrick::HTTPUtils::DefaultMimeTypes
|
179
|
+
mime_types.store 'js', 'application/javascript'
|
180
|
+
|
181
|
+
s = HTTPServer.new(
|
182
|
+
:Port => options['server_port'],
|
183
|
+
:MimeTypes => mime_types
|
184
|
+
)
|
185
|
+
s.mount(options['baseurl'], HTTPServlet::FileHandler, destination)
|
186
|
+
t = Thread.new {
|
187
|
+
s.start
|
188
|
+
}
|
189
|
+
|
190
|
+
trap("INT") { s.shutdown }
|
191
|
+
t.join()
|
192
|
+
end
|
data/cucumber.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
default: --format progress
|
@@ -0,0 +1,94 @@
|
|
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 posts:
|
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 layouts, pages, posts and files
|
41
|
+
Given I have a _layouts directory
|
42
|
+
And I have a page layout that contains "Page {{ page.title }}: {{ content }}"
|
43
|
+
And I have a post layout that contains "Post {{ page.title }}: {{ content }}"
|
44
|
+
And I have an "index.html" page with layout "page" that contains "Site contains {{ site.pages.size }} pages and {{ site.posts.size }} posts"
|
45
|
+
And I have a blog directory
|
46
|
+
And I have a "blog/index.html" page with layout "page" that contains "blog category index page"
|
47
|
+
And I have an "about.html" file that contains "No replacement {{ site.posts.size }}"
|
48
|
+
And I have an "another_file" file that contains ""
|
49
|
+
And I have a _posts directory
|
50
|
+
And I have the following posts:
|
51
|
+
| title | date | layout | content |
|
52
|
+
| entry1 | 3/27/2009 | post | content for entry1. |
|
53
|
+
| entry2 | 4/27/2009 | post | content for entry2. |
|
54
|
+
And I have a category/_posts directory
|
55
|
+
And I have the following posts in "category":
|
56
|
+
| title | date | layout | content |
|
57
|
+
| entry3 | 5/27/2009 | post | content for entry3. |
|
58
|
+
| entry4 | 6/27/2009 | post | content for entry4. |
|
59
|
+
When I run jekyll
|
60
|
+
Then the _site directory should exist
|
61
|
+
And I should see "Page : Site contains 2 pages and 4 posts" in "_site/index.html"
|
62
|
+
And I should see "No replacement \{\{ site.posts.size \}\}" in "_site/about.html"
|
63
|
+
And I should see "" in "_site/another_file"
|
64
|
+
And I should see "Page : blog category index page" in "_site/blog/index.html"
|
65
|
+
And I should see "Post entry1: <p>content for entry1.</p>" in "_site/2009/03/27/entry1.html"
|
66
|
+
And I should see "Post entry2: <p>content for entry2.</p>" in "_site/2009/04/27/entry2.html"
|
67
|
+
And I should see "Post entry3: <p>content for entry3.</p>" in "_site/category/2009/05/27/entry3.html"
|
68
|
+
And I should see "Post entry4: <p>content for entry4.</p>" in "_site/category/2009/06/27/entry4.html"
|
69
|
+
|
70
|
+
Scenario: Basic site with include tag
|
71
|
+
Given I have a _includes directory
|
72
|
+
And I have an "index.html" page that contains "Basic Site with include tag: {% include about.textile %}"
|
73
|
+
And I have an "_includes/about.textile" file that contains "Generated by Jekyll"
|
74
|
+
When I run jekyll
|
75
|
+
Then the _site directory should exist
|
76
|
+
And I should see "Basic Site with include tag: Generated by Jekyll" in "_site/index.html"
|
77
|
+
|
78
|
+
Scenario: Basic site with subdir include tag
|
79
|
+
Given I have a _includes directory
|
80
|
+
And I have an "_includes/about.textile" file that contains "Generated by Jekyll"
|
81
|
+
And I have an info directory
|
82
|
+
And I have an "info/index.html" page that contains "Basic Site with subdir include tag: {% include about.textile %}"
|
83
|
+
When I run jekyll
|
84
|
+
Then the _site directory should exist
|
85
|
+
And I should see "Basic Site with subdir include tag: Generated by Jekyll" in "_site/info/index.html"
|
86
|
+
|
87
|
+
Scenario: Basic site with nested include tag
|
88
|
+
Given I have a _includes directory
|
89
|
+
And I have an "_includes/about.textile" file that contains "Generated by {% include jekyll.textile %}"
|
90
|
+
And I have an "_includes/jekyll.textile" file that contains "Jekyll"
|
91
|
+
And I have an "index.html" page that contains "Basic Site with include tag: {% include about.textile %}"
|
92
|
+
When I debug jekyll
|
93
|
+
Then the _site directory should exist
|
94
|
+
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 "{{ page.title | xml_escape }}"
|
24
|
+
When I run jekyll
|
25
|
+
Then the _site directory should exist
|
26
|
+
And I should see "Star & 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 "{{ 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 "{{ page.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,30 @@
|
|
1
|
+
Feature: Markdown
|
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: Markdown in list on index
|
7
|
+
Given I have a configuration file with "paginate" set to "5"
|
8
|
+
And I have an "index.html" page that contains "Index - {% for post in site.posts %} {{ post.content }} {% endfor %}"
|
9
|
+
And I have a _posts directory
|
10
|
+
And I have the following post:
|
11
|
+
| title | date | content | type |
|
12
|
+
| Hackers | 3/27/2009 | # My Title | markdown |
|
13
|
+
When I run jekyll
|
14
|
+
Then the _site directory should exist
|
15
|
+
And I should see "Index" in "_site/index.html"
|
16
|
+
And I should see "<h1 id='my_title'>My Title</h1>" in "_site/2009/03/27/hackers.html"
|
17
|
+
And I should see "<h1 id='my_title'>My Title</h1>" in "_site/index.html"
|
18
|
+
|
19
|
+
Scenario: Markdown in pagination on index
|
20
|
+
Given I have a configuration file with "paginate" set to "5"
|
21
|
+
And I have an "index.html" page that contains "Index - {% for post in paginator.posts %} {{ post.content }} {% endfor %}"
|
22
|
+
And I have a _posts directory
|
23
|
+
And I have the following post:
|
24
|
+
| title | date | content | type |
|
25
|
+
| Hackers | 3/27/2009 | # My Title | markdown |
|
26
|
+
When I run jekyll
|
27
|
+
Then the _site directory should exist
|
28
|
+
And I should see "Index" in "_site/index.html"
|
29
|
+
And I should see "<h1 id='my_title'>My Title</h1>" in "_site/index.html"
|
30
|
+
|
@@ -0,0 +1,27 @@
|
|
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" page that contains "{{ paginator.posts.size }}"
|
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 play3. |
|
16
|
+
| Wargames4 | 6/27/2009 | default | The only winning move is not to play4. |
|
17
|
+
When I run jekyll
|
18
|
+
Then the _site/page<exist> directory should exist
|
19
|
+
And the "_site/page<exist>/index.html" file should exist
|
20
|
+
And I should see "<posts>" in "_site/page<exist>/index.html"
|
21
|
+
And the "_site/page<not_exist>/index.html" file should not exist
|
22
|
+
|
23
|
+
Examples:
|
24
|
+
| num | exist | posts | not_exist |
|
25
|
+
| 1 | 4 | 1 | 5 |
|
26
|
+
| 2 | 2 | 2 | 3 |
|
27
|
+
| 3 | 2 | 1 | 3 |
|
@@ -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"
|