jberkel-jekyll 0.5.4 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +37 -0
- data/README.textile +15 -8
- data/VERSION.yml +3 -2
- data/bin/jekyll +5 -1
- data/features/create_sites.feature +49 -1
- data/features/embed_filters.feature +3 -3
- data/features/markdown.feature +30 -0
- data/features/pagination.feature +12 -25
- data/features/post_data.feature +18 -18
- data/features/step_definitions/jekyll_steps.rb +8 -8
- data/jekyll.gemspec +14 -4
- data/lib/jekyll.rb +4 -3
- data/lib/jekyll/convertible.rb +6 -2
- data/lib/jekyll/core_ext.rb +22 -0
- data/lib/jekyll/page.rb +5 -1
- data/lib/jekyll/pager.rb +1 -1
- data/lib/jekyll/post.rb +13 -25
- data/lib/jekyll/site.rb +82 -68
- data/lib/jekyll/static_file.rb +28 -0
- data/lib/jekyll/tags/highlight.rb +14 -8
- data/test/helper.rb +1 -1
- 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-05-18-empty-tag.textile +6 -0
- data/test/source/_posts/2009-05-18-empty-tags.textile +6 -0
- data/test/source/_posts/2010-01-08-triple-dash.markdown +5 -0
- data/test/source/_posts/2010-01-09-date-override.textile +5 -0
- data/test/source/_posts/2010-01-09-time-override.textile +5 -0
- data/test/test_configuration.rb +5 -5
- data/test/test_core_ext.rb +66 -0
- data/test/test_generated_site.rb +4 -0
- data/test/test_pager.rb +92 -26
- data/test/test_post.rb +46 -3
- data/test/test_site.rb +8 -2
- data/test/test_tags.rb +2 -2
- metadata +71 -30
- data/lib/jekyll/converters/marley.rb +0 -53
data/test/test_site.rb
CHANGED
@@ -19,11 +19,17 @@ class TestSite < Test::Unit::TestCase
|
|
19
19
|
before_posts = @site.posts.length
|
20
20
|
before_layouts = @site.layouts.length
|
21
21
|
before_categories = @site.categories.length
|
22
|
+
before_tags = @site.tags.length
|
23
|
+
before_pages = @site.pages.length
|
24
|
+
before_static_files = @site.static_files.length
|
22
25
|
|
23
26
|
@site.process
|
24
27
|
assert_equal before_posts, @site.posts.length
|
25
28
|
assert_equal before_layouts, @site.layouts.length
|
26
29
|
assert_equal before_categories, @site.categories.length
|
30
|
+
assert_equal before_tags, @site.tags.length
|
31
|
+
assert_equal before_pages, @site.pages.length
|
32
|
+
assert_equal before_static_files, @site.static_files.length
|
27
33
|
end
|
28
34
|
|
29
35
|
should "read layouts" do
|
@@ -52,10 +58,10 @@ class TestSite < Test::Unit::TestCase
|
|
52
58
|
should "filter entries" do
|
53
59
|
ent1 = %w[foo.markdown bar.markdown baz.markdown #baz.markdown#
|
54
60
|
.baz.markdow foo.markdown~]
|
55
|
-
ent2 = %w[.htaccess _posts bla.bla]
|
61
|
+
ent2 = %w[.htaccess _posts _pages bla.bla]
|
56
62
|
|
57
63
|
assert_equal %w[foo.markdown bar.markdown baz.markdown], @site.filter_entries(ent1)
|
58
|
-
assert_equal
|
64
|
+
assert_equal %w[.htaccess bla.bla], @site.filter_entries(ent2)
|
59
65
|
end
|
60
66
|
|
61
67
|
should "filter entries with exclude" do
|
data/test/test_tags.rb
CHANGED
@@ -49,7 +49,7 @@ CONTENT
|
|
49
49
|
end
|
50
50
|
|
51
51
|
should "render markdown with pygments line handling" do
|
52
|
-
assert_match %{<pre>test\n</pre>}, @result
|
52
|
+
assert_match %{<pre><code class='text'>test\n</code></pre>}, @result
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
@@ -59,7 +59,7 @@ CONTENT
|
|
59
59
|
end
|
60
60
|
|
61
61
|
should "render markdown with pygments line handling" do
|
62
|
-
assert_match %{<pre>Æ\n</pre>}, @result
|
62
|
+
assert_match %{<pre><code class='text'>Æ\n</code></pre>}, @result
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jberkel-jekyll
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 5
|
8
|
+
- 7
|
9
|
+
version: 0.5.7
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Tom Preston-Werner
|
@@ -9,69 +14,93 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-03-14 00:00:00 +01:00
|
13
18
|
default_executable: jekyll
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: RedCloth
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 4
|
29
|
+
- 2
|
30
|
+
- 1
|
23
31
|
version: 4.2.1
|
24
|
-
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
25
34
|
- !ruby/object:Gem::Dependency
|
26
35
|
name: liquid
|
27
|
-
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
38
|
requirements:
|
31
39
|
- - ">="
|
32
40
|
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 1
|
43
|
+
- 9
|
44
|
+
- 0
|
33
45
|
version: 1.9.0
|
34
|
-
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id002
|
35
48
|
- !ruby/object:Gem::Dependency
|
36
49
|
name: classifier
|
37
|
-
|
38
|
-
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
52
|
requirements:
|
41
53
|
- - ">="
|
42
54
|
- !ruby/object:Gem::Version
|
55
|
+
segments:
|
56
|
+
- 1
|
57
|
+
- 3
|
58
|
+
- 1
|
43
59
|
version: 1.3.1
|
44
|
-
|
60
|
+
type: :runtime
|
61
|
+
version_requirements: *id003
|
45
62
|
- !ruby/object:Gem::Dependency
|
46
63
|
name: maruku
|
47
|
-
|
48
|
-
|
49
|
-
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
prerelease: false
|
65
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
50
66
|
requirements:
|
51
67
|
- - ">="
|
52
68
|
- !ruby/object:Gem::Version
|
69
|
+
segments:
|
70
|
+
- 0
|
71
|
+
- 5
|
72
|
+
- 9
|
53
73
|
version: 0.5.9
|
54
|
-
|
74
|
+
type: :runtime
|
75
|
+
version_requirements: *id004
|
55
76
|
- !ruby/object:Gem::Dependency
|
56
77
|
name: directory_watcher
|
57
|
-
|
58
|
-
|
59
|
-
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
prerelease: false
|
79
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
60
80
|
requirements:
|
61
81
|
- - ">="
|
62
82
|
- !ruby/object:Gem::Version
|
83
|
+
segments:
|
84
|
+
- 1
|
85
|
+
- 1
|
86
|
+
- 1
|
63
87
|
version: 1.1.1
|
64
|
-
|
88
|
+
type: :runtime
|
89
|
+
version_requirements: *id005
|
65
90
|
- !ruby/object:Gem::Dependency
|
66
91
|
name: open4
|
67
|
-
|
68
|
-
|
69
|
-
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
prerelease: false
|
93
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
70
94
|
requirements:
|
71
95
|
- - ">="
|
72
96
|
- !ruby/object:Gem::Version
|
97
|
+
segments:
|
98
|
+
- 0
|
99
|
+
- 9
|
100
|
+
- 6
|
73
101
|
version: 0.9.6
|
74
|
-
|
102
|
+
type: :runtime
|
103
|
+
version_requirements: *id006
|
75
104
|
description: Jekyll is a simple, blog aware, static site generator.
|
76
105
|
email: tom@mojombo.com
|
77
106
|
executables:
|
@@ -89,6 +118,7 @@ files:
|
|
89
118
|
- bin/jekyll
|
90
119
|
- features/create_sites.feature
|
91
120
|
- features/embed_filters.feature
|
121
|
+
- features/markdown.feature
|
92
122
|
- features/pagination.feature
|
93
123
|
- features/permalinks.feature
|
94
124
|
- features/post_data.feature
|
@@ -100,7 +130,6 @@ files:
|
|
100
130
|
- lib/jekyll.rb
|
101
131
|
- lib/jekyll/albino.rb
|
102
132
|
- lib/jekyll/converters/csv.rb
|
103
|
-
- lib/jekyll/converters/marley.rb
|
104
133
|
- lib/jekyll/converters/mephisto.rb
|
105
134
|
- lib/jekyll/converters/mt.rb
|
106
135
|
- lib/jekyll/converters/textpattern.rb
|
@@ -115,6 +144,7 @@ files:
|
|
115
144
|
- lib/jekyll/pager.rb
|
116
145
|
- lib/jekyll/post.rb
|
117
146
|
- lib/jekyll/site.rb
|
147
|
+
- lib/jekyll/static_file.rb
|
118
148
|
- lib/jekyll/tags/highlight.rb
|
119
149
|
- lib/jekyll/tags/include.rb
|
120
150
|
- test/helper.rb
|
@@ -130,11 +160,18 @@ files:
|
|
130
160
|
- test/source/_posts/2009-01-27-array-categories.textile
|
131
161
|
- test/source/_posts/2009-01-27-categories.textile
|
132
162
|
- test/source/_posts/2009-01-27-category.textile
|
163
|
+
- test/source/_posts/2009-01-27-empty-categories.textile
|
164
|
+
- test/source/_posts/2009-01-27-empty-category.textile
|
133
165
|
- test/source/_posts/2009-03-12-hash-#1.markdown
|
166
|
+
- test/source/_posts/2009-05-18-empty-tag.textile
|
167
|
+
- test/source/_posts/2009-05-18-empty-tags.textile
|
134
168
|
- test/source/_posts/2009-05-18-tag.textile
|
135
169
|
- test/source/_posts/2009-05-18-tags.textile
|
136
170
|
- test/source/_posts/2009-06-22-empty-yaml.textile
|
137
171
|
- test/source/_posts/2009-06-22-no-yaml.textile
|
172
|
+
- test/source/_posts/2010-01-08-triple-dash.markdown
|
173
|
+
- test/source/_posts/2010-01-09-date-override.textile
|
174
|
+
- test/source/_posts/2010-01-09-time-override.textile
|
138
175
|
- test/source/about.html
|
139
176
|
- test/source/category/_posts/2008-9-23-categories.textile
|
140
177
|
- test/source/contacts.html
|
@@ -146,6 +183,7 @@ files:
|
|
146
183
|
- test/source/z_category/_posts/2008-9-23-categories.textile
|
147
184
|
- test/suite.rb
|
148
185
|
- test/test_configuration.rb
|
186
|
+
- test/test_core_ext.rb
|
149
187
|
- test/test_filters.rb
|
150
188
|
- test/test_generated_site.rb
|
151
189
|
- test/test_page.rb
|
@@ -166,18 +204,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
166
204
|
requirements:
|
167
205
|
- - ">="
|
168
206
|
- !ruby/object:Gem::Version
|
207
|
+
segments:
|
208
|
+
- 0
|
169
209
|
version: "0"
|
170
|
-
version:
|
171
210
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
211
|
requirements:
|
173
212
|
- - ">="
|
174
213
|
- !ruby/object:Gem::Version
|
214
|
+
segments:
|
215
|
+
- 0
|
175
216
|
version: "0"
|
176
|
-
version:
|
177
217
|
requirements: []
|
178
218
|
|
179
219
|
rubyforge_project: jekyll
|
180
|
-
rubygems_version: 1.3.
|
220
|
+
rubygems_version: 1.3.6
|
181
221
|
signing_key:
|
182
222
|
specification_version: 3
|
183
223
|
summary: Jekyll is a simple, blog aware, static site generator.
|
@@ -185,6 +225,7 @@ test_files:
|
|
185
225
|
- test/helper.rb
|
186
226
|
- test/suite.rb
|
187
227
|
- test/test_configuration.rb
|
228
|
+
- test/test_core_ext.rb
|
188
229
|
- test/test_filters.rb
|
189
230
|
- test/test_generated_site.rb
|
190
231
|
- test/test_page.rb
|
@@ -1,53 +0,0 @@
|
|
1
|
-
require 'yaml'
|
2
|
-
require 'fileutils'
|
3
|
-
|
4
|
-
module Jekyll
|
5
|
-
module Marley
|
6
|
-
|
7
|
-
def self.regexp
|
8
|
-
{ :id => /^\d{0,4}-{0,1}(.*)$/,
|
9
|
-
:title => /^#\s*(.*)\s+$/,
|
10
|
-
:title_with_date => /^#\s*(.*)\s+\(([0-9\/]+)\)$/,
|
11
|
-
:published_on => /.*\s+\(([0-9\/]+)\)$/,
|
12
|
-
:perex => /^([^\#\n]+\n)$/,
|
13
|
-
:meta => /^\{\{\n(.*)\}\}\n$/mi # Multiline Regexp
|
14
|
-
}
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.process(marley_data_dir)
|
18
|
-
raise ArgumentError, "marley dir #{marley_data_dir} not found" unless File.directory?(marley_data_dir)
|
19
|
-
|
20
|
-
FileUtils.mkdir_p "_posts"
|
21
|
-
|
22
|
-
posts = 0
|
23
|
-
Dir["#{marley_data_dir}/**/*.txt"].each do |f|
|
24
|
-
next unless File.exists?(f)
|
25
|
-
|
26
|
-
#copied over from marley's app/lib/post.rb
|
27
|
-
file_content = File.read(f)
|
28
|
-
meta_content = file_content.slice!( self.regexp[:meta] )
|
29
|
-
body = file_content.sub( self.regexp[:title], '').sub( self.regexp[:perex], '').strip
|
30
|
-
|
31
|
-
title = file_content.scan( self.regexp[:title] ).first.to_s.strip
|
32
|
-
prerex = file_content.scan( self.regexp[:perex] ).first.to_s.strip
|
33
|
-
published_on = DateTime.parse( post[:published_on] ) rescue File.mtime( File.dirname(f) )
|
34
|
-
meta = ( meta_content ) ? YAML::load( meta_content.scan( self.regexp[:meta]).to_s ) : {}
|
35
|
-
meta['title'] = title
|
36
|
-
meta['layout'] = 'post'
|
37
|
-
|
38
|
-
formatted_date = published_on.strftime('%Y-%m-%d')
|
39
|
-
post_name = File.dirname(f).split(%r{/}).last.gsub(/\A\d+-/, '')
|
40
|
-
|
41
|
-
name = "#{formatted_date}-#{post_name}"
|
42
|
-
File.open("_posts/#{name}.markdown", "w") do |f|
|
43
|
-
f.puts meta.to_yaml
|
44
|
-
f.puts "---\n"
|
45
|
-
f.puts "\n#{prerex}\n\n" if prerex
|
46
|
-
f.puts body
|
47
|
-
end
|
48
|
-
posts += 1
|
49
|
-
end
|
50
|
-
"Created #{posts} posts!"
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|