qrush-jekyll 0.3.0.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +19 -0
- data/README.textile +64 -24
- data/VERSION.yml +4 -0
- data/bin/jekyll +9 -0
- data/lib/jekyll/converters/mephisto.rb +56 -1
- data/lib/jekyll/converters/textpattern.rb +50 -0
- data/lib/jekyll/converters/typo.rb +49 -0
- data/lib/jekyll/converters/wordpress.rb +9 -8
- data/lib/jekyll/convertible.rb +14 -3
- data/lib/jekyll/post.rb +23 -5
- data/lib/jekyll/site.rb +30 -20
- data/lib/jekyll/tags/highlight.rb +20 -4
- data/lib/jekyll.rb +7 -3
- data/test/helper.rb +2 -1
- data/test/source/category/_posts/2008-9-23-categories.textile +6 -0
- data/test/source/foo/_posts/bar/2008-12-12-topical-post.textile +8 -0
- data/test/source/z_category/_posts/2008-9-23-categories.textile +6 -0
- data/test/test_filters.rb +37 -0
- data/test/test_generated_site.rb +14 -3
- data/test/test_post.rb +38 -2
- data/test/test_site.rb +12 -6
- data/test/test_tags.rb +31 -0
- metadata +85 -36
- data/Manifest.txt +0 -38
- data/Rakefile +0 -29
- data/jekyll.gemspec +0 -51
data/History.txt
CHANGED
@@ -1,8 +1,27 @@
|
|
1
1
|
==
|
2
|
+
* Minor Enhancements
|
3
|
+
* Changed date format on wordpress converter (zeropadding) [github.com/dysinger]
|
4
|
+
* Bug Fixes
|
5
|
+
* Add jekyll binary as executable to gemspec [github.com/dysinger]
|
6
|
+
|
7
|
+
== 0.4.0 / 2009-02-03
|
8
|
+
* Major Enhancements
|
9
|
+
* Switch to Jeweler for packaging tasks
|
2
10
|
* Minor Enhancements
|
3
11
|
* Type importer [github.com/codeslinger]
|
4
12
|
* site.topics accessor [github.com/baz]
|
5
13
|
* Add array_to_sentence_string filter [github.com/mchung]
|
14
|
+
* Add a converter for textpattern [github.com/PerfectlyNormal]
|
15
|
+
* Add a working Mephisto / MySQL converter [github.com/ivey]
|
16
|
+
* Allowing .htaccess files to be copied over into the generated site [github.com/briandoll]
|
17
|
+
* Add option to not put file date in permalink URL [github.com/mreid]
|
18
|
+
* Add line number capabilities to highlight blocks [github.com/jcon]
|
19
|
+
* Bug Fixes
|
20
|
+
* Fix permalink behavior [github.com/cavalle]
|
21
|
+
* Fixed an issue with pygments, markdown, and newlines [github.com/zpinter]
|
22
|
+
* Ampersands need to be escaped [github.com/pufuwozu, github.com/ap]
|
23
|
+
* Test and fix the site.categories hash [github.com/zzot]
|
24
|
+
* Fix site payload available to files [github.com/matrix9180]
|
6
25
|
|
7
26
|
== 0.3.0 / 2008-12-24
|
8
27
|
* Major Enhancements
|
data/README.textile
CHANGED
@@ -34,7 +34,7 @@ fields such as <code>title</code> and <code>date</code>.
|
|
34
34
|
Jekyll gets the list of blog posts by parsing the files in any
|
35
35
|
"_posts":http://github.com/mojombo/tpw/tree/master/_posts directory found in
|
36
36
|
subdirectories below the root.
|
37
|
-
Each post's filename contains the publishing date and slug (what shows up in the
|
37
|
+
Each post's filename contains (by default) the publishing date and slug (what shows up in the
|
38
38
|
URL) that the final HTML file should have. Open up the file corresponding to a
|
39
39
|
blog post:
|
40
40
|
"2008-11-17-blogging-like-a-hacker.textile":http://github.com/mojombo/tpw/tree/master/_posts/2008-11-17-blogging-like-a-hacker.textile.
|
@@ -145,6 +145,17 @@ Default port is 4000:
|
|
145
145
|
|
146
146
|
$ jekyll --server [PORT]
|
147
147
|
|
148
|
+
By default, the permalink for each post begins with its date in 'YYYY/MM/DD'
|
149
|
+
format. If you do not wish to have the date appear in the URL of each post,
|
150
|
+
you can change the permalink style to 'none' so that only the 'slug' part of
|
151
|
+
the filename is used. For example, with the permalink style set to 'none' the
|
152
|
+
file '2009-01-01-happy-new-year.markdown' will have a permalink like
|
153
|
+
'http://yoursite.com/happy-new-year.html'. The date of the post will still be
|
154
|
+
read from the filename (and is required!) to be used elsewhere in Jekyll.
|
155
|
+
Example usage:
|
156
|
+
|
157
|
+
$ jekyll --permalink none
|
158
|
+
|
148
159
|
h2. Data
|
149
160
|
|
150
161
|
Jekyll traverses your site looking for files to process. Any files with YAML
|
@@ -331,17 +342,33 @@ The argument to <code>highlight</code> is the language identifier. To find the
|
|
331
342
|
appropriate identifier to use for your favorite language, look for the "short
|
332
343
|
name" on the "Lexers":http://pygments.org/docs/lexers/ page.
|
333
344
|
|
345
|
+
There is a second argument to <code>highlight</code> called
|
346
|
+
<code>linenos</code> that is optional. Including the <code>linenos</code>
|
347
|
+
argument will force the highlighted code to include line numbers. For
|
348
|
+
instance, the following code block would include line numbers next to each
|
349
|
+
line:
|
350
|
+
|
351
|
+
<pre>
|
352
|
+
{% highlight ruby linenos %}
|
353
|
+
def foo
|
354
|
+
puts 'foo'
|
355
|
+
end
|
356
|
+
{% endhighlight %}
|
357
|
+
</pre>
|
358
|
+
|
334
359
|
In order for the highlighting to show up, you'll need to include a
|
335
360
|
highlighting stylesheet. For an example stylesheet you can look at
|
336
361
|
"syntax.css":http://github.com/mojombo/tpw/tree/master/css/syntax.css. These
|
337
362
|
are the same styles as used by GitHub and you are free to use them for your
|
338
|
-
own site.
|
363
|
+
own site. If you use linenos, you might want to include an additional CSS
|
364
|
+
class definition for <code>lineno</code> in syntax.css to distinguish the line
|
365
|
+
numbers from the highlighted code.
|
339
366
|
|
340
367
|
h2. Categories
|
341
368
|
|
342
|
-
Posts are placed into categories based on the directory structure they are
|
343
|
-
within (see above for an example). The categories can be accessed from
|
344
|
-
a Liquid template as follows:
|
369
|
+
Posts are placed into categories based on the directory structure they are
|
370
|
+
found within (see above for an example). The categories can be accessed from
|
371
|
+
within a Liquid template as follows:
|
345
372
|
|
346
373
|
<pre>
|
347
374
|
{% for post in site.categories.foo %}
|
@@ -353,25 +380,6 @@ This would list all the posts in the category 'foo' by date and title.
|
|
353
380
|
|
354
381
|
The posts within each category are sorted in reverse chronological order.
|
355
382
|
|
356
|
-
h2. Contribute
|
357
|
-
|
358
|
-
If you'd like to hack on Jekyll, grab the source from GitHub. To get
|
359
|
-
all of the dependencies, install the gem first.
|
360
|
-
|
361
|
-
$ git clone git://github.com/mojombo/jekyll
|
362
|
-
|
363
|
-
The best way to get your changes merged back into core is as follows:
|
364
|
-
|
365
|
-
# Fork mojombo/jekyll on GitHub
|
366
|
-
# Clone down your fork
|
367
|
-
# Create a topic branch to contain your change
|
368
|
-
# Hack away
|
369
|
-
# If you are adding new functionality, document it in README.textile
|
370
|
-
# Do not change the version number, I will do that on my end
|
371
|
-
# If necessary, rebase your commits into logical chunks, without errors
|
372
|
-
# Push the branch up to GitHub
|
373
|
-
# Send me (mojombo) a pull request for your branch
|
374
|
-
|
375
383
|
h2. Blog migrations
|
376
384
|
|
377
385
|
h3. Movable Type
|
@@ -409,6 +417,38 @@ This code also has only been tested with Typo version 4+. Previous versions
|
|
409
417
|
of Typo may not convert correctly. Please check the results and verify the
|
410
418
|
posts before publishing.
|
411
419
|
|
420
|
+
h3. TextPattern 4
|
421
|
+
|
422
|
+
To migrate your TextPattern blog into Jekyll, you'll need read access to the MySQL
|
423
|
+
database. The lib/jekyll/converters/textpattern.rb module provides a simple convert to create .textile files in a _posts directory based on
|
424
|
+
the entries contained therein.
|
425
|
+
|
426
|
+
$ ruby -r './lib/jekyll/converters/textpattern' -e 'Jekyll::TextPattern.process( \
|
427
|
+
"database_name", "username", "password", "hostname")'
|
428
|
+
|
429
|
+
The hostname defaults to _localhost_, all other variables are needed
|
430
|
+
You may need to adjust the code used to filter entries. Left alone,
|
431
|
+
it will attempt to pull all entries that are live or sticky.
|
432
|
+
|
433
|
+
h2. Contribute
|
434
|
+
|
435
|
+
If you'd like to hack on Jekyll, start by forking my repo on GitHub:
|
436
|
+
|
437
|
+
http://github.com/mojombo/jekyll
|
438
|
+
|
439
|
+
To get all of the dependencies, install the gem first. The best way to get
|
440
|
+
your changes merged back into core is as follows:
|
441
|
+
|
442
|
+
# Clone down your fork
|
443
|
+
# Create a topic branch to contain your change
|
444
|
+
# Hack away
|
445
|
+
# Add tests and make sure everything still passes by running `rake`
|
446
|
+
# If you are adding new functionality, document it in README.textile
|
447
|
+
# Do not change the version number, I will do that on my end
|
448
|
+
# If necessary, rebase your commits into logical chunks, without errors
|
449
|
+
# Push the branch up to GitHub
|
450
|
+
# Send me (mojombo) a pull request for your branch
|
451
|
+
|
412
452
|
h2. License
|
413
453
|
|
414
454
|
(The MIT License)
|
data/VERSION.yml
ADDED
data/bin/jekyll
CHANGED
@@ -47,6 +47,15 @@ opts = OptionParser.new do |opts|
|
|
47
47
|
puts 'You must have the rdiscount gem installed first'
|
48
48
|
end
|
49
49
|
end
|
50
|
+
|
51
|
+
opts.on("--permalink [TYPE]", "Use 'date' (default) for YYYY/MM/DD") do |style|
|
52
|
+
Jekyll.permalink_style = (style || 'date').to_sym
|
53
|
+
end
|
54
|
+
|
55
|
+
opts.on("--version", "Display current version") do
|
56
|
+
puts "Jekyll " + Jekyll.version
|
57
|
+
exit 0
|
58
|
+
end
|
50
59
|
end
|
51
60
|
|
52
61
|
opts.parse!
|
@@ -1,7 +1,19 @@
|
|
1
|
+
# Quickly hacked together my Michael Ivey
|
2
|
+
# Based on mt.rb by Nick Gerakines, open source and publically
|
3
|
+
# available under the MIT license. Use this module at your own risk.
|
4
|
+
|
1
5
|
require 'rubygems'
|
6
|
+
require 'sequel'
|
2
7
|
require 'fastercsv'
|
3
8
|
require 'fileutils'
|
4
9
|
require File.join(File.dirname(__FILE__),"csv.rb")
|
10
|
+
|
11
|
+
# NOTE: This converter requires Sequel and the MySQL gems.
|
12
|
+
# The MySQL gem can be difficult to install on OS X. Once you have MySQL
|
13
|
+
# installed, running the following commands should work:
|
14
|
+
# $ sudo gem install sequel
|
15
|
+
# $ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
|
16
|
+
|
5
17
|
module Jekyll
|
6
18
|
module Mephisto
|
7
19
|
#Accepts a hash with database config variables, exports mephisto posts into a csv
|
@@ -20,5 +32,48 @@ module Jekyll
|
|
20
32
|
`#{command}`
|
21
33
|
CSV.process
|
22
34
|
end
|
35
|
+
|
36
|
+
# This query will pull blog posts from all entries across all blogs. If
|
37
|
+
# you've got unpublished, deleted or otherwise hidden posts please sift
|
38
|
+
# through the created posts to make sure nothing is accidently published.
|
39
|
+
|
40
|
+
QUERY = "SELECT id, permalink, body, published_at, title FROM contents WHERE user_id = 1 AND type = 'Article' AND published_at IS NOT NULL ORDER BY published_at"
|
41
|
+
|
42
|
+
def self.process(dbname, user, pass, host = 'localhost')
|
43
|
+
db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host)
|
44
|
+
|
45
|
+
FileUtils.mkdir_p "_posts"
|
46
|
+
|
47
|
+
db[QUERY].each do |post|
|
48
|
+
title = post[:title]
|
49
|
+
slug = post[:permalink]
|
50
|
+
date = post[:published_at]
|
51
|
+
content = post[:body]
|
52
|
+
# more_content = ''
|
53
|
+
|
54
|
+
# Be sure to include the body and extended body.
|
55
|
+
# if more_content != nil
|
56
|
+
# content = content + " \n" + more_content
|
57
|
+
# end
|
58
|
+
|
59
|
+
# Ideally, this script would determine the post format (markdown, html
|
60
|
+
# , etc) and create files with proper extensions. At this point it
|
61
|
+
# just assumes that markdown will be acceptable.
|
62
|
+
name = [date.year, date.month, date.day, slug].join('-') + ".markdown"
|
63
|
+
|
64
|
+
data = {
|
65
|
+
'layout' => 'post',
|
66
|
+
'title' => title.to_s,
|
67
|
+
'mt_id' => post[:entry_id],
|
68
|
+
}.delete_if { |k,v| v.nil? || v == ''}.to_yaml
|
69
|
+
|
70
|
+
File.open("_posts/#{name}", "w") do |f|
|
71
|
+
f.puts data
|
72
|
+
f.puts "---"
|
73
|
+
f.puts content
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
23
78
|
end
|
24
|
-
end
|
79
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'sequel'
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
# NOTE: This converter requires Sequel and the MySQL gems.
|
6
|
+
# The MySQL gem can be difficult to install on OS X. Once you have MySQL
|
7
|
+
# installed, running the following commands should work:
|
8
|
+
# $ sudo gem install sequel
|
9
|
+
# $ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
|
10
|
+
|
11
|
+
module Jekyll
|
12
|
+
module TextPattern
|
13
|
+
# Reads a MySQL database via Sequel and creates a post file for each post.
|
14
|
+
# The only posts selected are those with a status of 4 or 5, which means "live"
|
15
|
+
# and "sticky" respectively.
|
16
|
+
# Other statuses is 1 => draft, 2 => hidden and 3 => pending
|
17
|
+
QUERY = "select Title, url_title, Posted, Body, Keywords from textpattern where Status = '4' or Status = '5'"
|
18
|
+
|
19
|
+
def self.process(dbname, user, pass, host = 'localhost')
|
20
|
+
db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host)
|
21
|
+
|
22
|
+
FileUtils.mkdir_p "_posts"
|
23
|
+
|
24
|
+
db[QUERY].each do |post|
|
25
|
+
# Get required fields and construct Jekyll compatible name
|
26
|
+
title = post[:Title]
|
27
|
+
slug = post[:url_title]
|
28
|
+
date = post[:Posted]
|
29
|
+
content = post[:Body]
|
30
|
+
|
31
|
+
name = [date.strftime("%Y-%m-%d"), slug].join('-') + ".textile"
|
32
|
+
|
33
|
+
# Get the relevant fields as a hash, delete empty fields and convert
|
34
|
+
# to YAML for the header
|
35
|
+
data = {
|
36
|
+
'layout' => 'post',
|
37
|
+
'title' => title.to_s,
|
38
|
+
'tags' => post[:Keywords].split(',')
|
39
|
+
}.delete_if { |k,v| v.nil? || v == ''}.to_yaml
|
40
|
+
|
41
|
+
# Write out the data and content to file
|
42
|
+
File.open("_posts/#{name}", "w") do |f|
|
43
|
+
f.puts data
|
44
|
+
f.puts "---"
|
45
|
+
f.puts content
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# Author: Toby DiPasquale <toby@cbcg.net>
|
2
|
+
require 'fileutils'
|
3
|
+
require 'rubygems'
|
4
|
+
require 'sequel'
|
5
|
+
|
6
|
+
module Jekyll
|
7
|
+
module Typo
|
8
|
+
# this SQL *should* work for both MySQL and PostgreSQL, but I haven't
|
9
|
+
# tested PostgreSQL yet (as of 2008-12-16)
|
10
|
+
SQL = <<-EOS
|
11
|
+
SELECT c.id id,
|
12
|
+
c.title title,
|
13
|
+
c.permalink slug,
|
14
|
+
c.body body,
|
15
|
+
c.published_at date,
|
16
|
+
c.state state,
|
17
|
+
COALESCE(tf.name, 'html') filter
|
18
|
+
FROM contents c
|
19
|
+
LEFT OUTER JOIN text_filters tf
|
20
|
+
ON c.text_filter_id = tf.id
|
21
|
+
EOS
|
22
|
+
|
23
|
+
def self.process dbname, user, pass, host='localhost'
|
24
|
+
FileUtils.mkdir_p '_posts'
|
25
|
+
db = Sequel.mysql dbname, :user => user, :password => pass, :host => host
|
26
|
+
db[SQL].each do |post|
|
27
|
+
next unless post[:state] =~ /Published/
|
28
|
+
|
29
|
+
name = [ sprintf("%.04d", post[:date].year),
|
30
|
+
sprintf("%.02d", post[:date].month),
|
31
|
+
sprintf("%.02d", post[:date].day),
|
32
|
+
post[:slug].strip ].join('-')
|
33
|
+
# Can have more than one text filter in this field, but we just want
|
34
|
+
# the first one for this
|
35
|
+
name += '.' + post[:filter].split(' ')[0]
|
36
|
+
|
37
|
+
File.open("_posts/#{name}", 'w') do |f|
|
38
|
+
f.puts({ 'layout' => 'post',
|
39
|
+
'title' => post[:title].to_s,
|
40
|
+
'typo_id' => post[:id]
|
41
|
+
}.delete_if { |k, v| v.nil? || v == '' }.to_yaml)
|
42
|
+
f.puts '---'
|
43
|
+
f.puts post[:body].delete("\r")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end # module Typo
|
49
|
+
end # module Jekyll
|
@@ -10,8 +10,8 @@ require 'fileutils'
|
|
10
10
|
|
11
11
|
module Jekyll
|
12
12
|
module WordPress
|
13
|
-
|
14
|
-
# Reads a MySQL database via Sequel and creates a post file for each
|
13
|
+
|
14
|
+
# Reads a MySQL database via Sequel and creates a post file for each
|
15
15
|
# post in wp_posts that has post_status = 'publish'.
|
16
16
|
# This restriction is made because 'draft' posts are not guaranteed to
|
17
17
|
# have valid dates.
|
@@ -19,20 +19,21 @@ module Jekyll
|
|
19
19
|
|
20
20
|
def self.process(dbname, user, pass, host = 'localhost')
|
21
21
|
db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host)
|
22
|
-
|
22
|
+
|
23
23
|
FileUtils.mkdir_p "_posts"
|
24
|
-
|
24
|
+
|
25
25
|
db[QUERY].each do |post|
|
26
26
|
# Get required fields and construct Jekyll compatible name
|
27
27
|
title = post[:post_title]
|
28
28
|
slug = post[:post_name]
|
29
29
|
date = post[:post_date]
|
30
30
|
content = post[:post_content]
|
31
|
-
|
32
|
-
name = [date.year, date.month, date.day,
|
31
|
+
|
32
|
+
name = "%02d-%02d-%02d-%s.markdown" % [date.year, date.month, date.day,
|
33
|
+
slug]
|
33
34
|
|
34
35
|
# Get the relevant fields as a hash, delete empty fields and convert
|
35
|
-
# to YAML for the header
|
36
|
+
# to YAML for the header
|
36
37
|
data = {
|
37
38
|
'layout' => 'post',
|
38
39
|
'title' => title.to_s,
|
@@ -51,4 +52,4 @@ module Jekyll
|
|
51
52
|
|
52
53
|
end
|
53
54
|
end
|
54
|
-
end
|
55
|
+
end
|
data/lib/jekyll/convertible.rb
CHANGED
@@ -24,16 +24,26 @@ module Jekyll
|
|
24
24
|
#
|
25
25
|
# Returns nothing
|
26
26
|
def transform
|
27
|
-
case
|
28
|
-
when
|
27
|
+
case Jekyll.content_type
|
28
|
+
when :textile
|
29
29
|
self.ext = ".html"
|
30
30
|
self.content = RedCloth.new(self.content).to_html
|
31
|
-
when
|
31
|
+
when :markdown
|
32
32
|
self.ext = ".html"
|
33
33
|
self.content = Jekyll.markdown_proc.call(self.content)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
def determine_content_type
|
38
|
+
case self.ext[1..-1]
|
39
|
+
when /textile/i
|
40
|
+
return :textile
|
41
|
+
when /markdown/i, /mkdn/i, /md/i
|
42
|
+
return :markdown
|
43
|
+
end
|
44
|
+
return :unknown
|
45
|
+
end
|
46
|
+
|
37
47
|
# Add any necessary layouts to this convertible document
|
38
48
|
# +layouts+ is a Hash of {"name" => "layout"}
|
39
49
|
# +site_payload+ is the site payload hash
|
@@ -41,6 +51,7 @@ module Jekyll
|
|
41
51
|
# Returns nothing
|
42
52
|
def do_layout(payload, layouts)
|
43
53
|
# render and transform content (this becomes the final content of the object)
|
54
|
+
Jekyll.content_type = self.determine_content_type
|
44
55
|
self.content = Liquid::Template.parse(self.content).render(payload, [Jekyll::Filters])
|
45
56
|
self.transform
|
46
57
|
|
data/lib/jekyll/post.rb
CHANGED
@@ -18,7 +18,7 @@ module Jekyll
|
|
18
18
|
name =~ MATCHER
|
19
19
|
end
|
20
20
|
|
21
|
-
attr_accessor :date, :slug, :ext, :categories, :topics
|
21
|
+
attr_accessor :date, :slug, :ext, :categories, :topics, :published
|
22
22
|
attr_accessor :data, :content, :output
|
23
23
|
|
24
24
|
# Initialize this Post instance.
|
@@ -38,6 +38,20 @@ module Jekyll
|
|
38
38
|
|
39
39
|
self.process(name)
|
40
40
|
self.read_yaml(@base, name)
|
41
|
+
|
42
|
+
if self.data.has_key?('published') && self.data['published'] == false
|
43
|
+
self.published = false
|
44
|
+
else
|
45
|
+
self.published = true
|
46
|
+
end
|
47
|
+
|
48
|
+
if self.categories.empty?
|
49
|
+
if self.data.has_key?('category')
|
50
|
+
self.categories << self.data['category']
|
51
|
+
elsif self.data.has_key?('categories')
|
52
|
+
self.categories = self.data['categories'].split
|
53
|
+
end
|
54
|
+
end
|
41
55
|
end
|
42
56
|
|
43
57
|
# Spaceship is based on Post#date
|
@@ -61,15 +75,19 @@ module Jekyll
|
|
61
75
|
# The generated directory into which the post will be placed
|
62
76
|
# upon generation. This is derived from the permalink or, if
|
63
77
|
# permalink is absent, set to the default date
|
64
|
-
# e.g. "/2008/11/05/"
|
78
|
+
# e.g. "/2008/11/05/" if the permalink style is :date, otherwise nothing
|
65
79
|
#
|
66
80
|
# Returns <String>
|
67
81
|
def dir
|
68
82
|
if permalink
|
69
|
-
permalink.to_s.split("/")[0..-2].join("/")
|
83
|
+
permalink.to_s.split("/")[0..-2].join("/") + '/'
|
70
84
|
else
|
71
85
|
prefix = self.categories.empty? ? '' : '/' + self.categories.join('/')
|
72
|
-
|
86
|
+
if Jekyll.permalink_style == :date
|
87
|
+
prefix + date.strftime("/%Y/%m/%d/")
|
88
|
+
else
|
89
|
+
prefix + '/'
|
90
|
+
end
|
73
91
|
end
|
74
92
|
end
|
75
93
|
|
@@ -87,7 +105,7 @@ module Jekyll
|
|
87
105
|
#
|
88
106
|
# Returns <String>
|
89
107
|
def url
|
90
|
-
self.dir + self.slug + ".html"
|
108
|
+
permalink || self.dir + self.slug + ".html"
|
91
109
|
end
|
92
110
|
|
93
111
|
# The UID for this post (useful in feeds)
|
data/lib/jekyll/site.rb
CHANGED
@@ -2,7 +2,7 @@ module Jekyll
|
|
2
2
|
|
3
3
|
class Site
|
4
4
|
attr_accessor :source, :dest
|
5
|
-
attr_accessor :layouts, :posts
|
5
|
+
attr_accessor :layouts, :posts, :categories
|
6
6
|
|
7
7
|
# Initialize the site
|
8
8
|
# +source+ is String path to the source directory containing
|
@@ -16,6 +16,7 @@ module Jekyll
|
|
16
16
|
self.dest = dest
|
17
17
|
self.layouts = {}
|
18
18
|
self.posts = []
|
19
|
+
self.categories = Hash.new { |hash, key| hash[key] = Array.new }
|
19
20
|
end
|
20
21
|
|
21
22
|
# Do the actual work of processing the site and generating the
|
@@ -62,7 +63,11 @@ module Jekyll
|
|
62
63
|
entries.each do |f|
|
63
64
|
if Post.valid?(f)
|
64
65
|
post = Post.new(self.source, dir, f)
|
65
|
-
|
66
|
+
|
67
|
+
if post.published
|
68
|
+
self.posts << post
|
69
|
+
post.categories.each { |c| self.categories[c] << post }
|
70
|
+
end
|
66
71
|
end
|
67
72
|
end
|
68
73
|
|
@@ -72,6 +77,7 @@ module Jekyll
|
|
72
77
|
end
|
73
78
|
|
74
79
|
self.posts.sort!
|
80
|
+
self.categories.values.map { |cats| cats.sort! { |a, b| b <=> a} }
|
75
81
|
rescue Errno::ENOENT => e
|
76
82
|
# ignore missing layout dir
|
77
83
|
end
|
@@ -88,7 +94,8 @@ module Jekyll
|
|
88
94
|
# Copy all regular files from <source> to <dest>/ ignoring
|
89
95
|
# any files/directories that are hidden or backup files (start
|
90
96
|
# with "." or end with "~") or contain site content (start with "_")
|
91
|
-
# unless they are "_posts" directories
|
97
|
+
# unless they are "_posts" directories or web server files such as
|
98
|
+
# '.htaccess'
|
92
99
|
# The +dir+ String is a relative path used to call this method
|
93
100
|
# recursively as it descends through directories
|
94
101
|
#
|
@@ -98,8 +105,10 @@ module Jekyll
|
|
98
105
|
entries = Dir.entries(base)
|
99
106
|
entries = entries.reject { |e| e[-1..-1] == '~' }
|
100
107
|
entries = entries.reject do |e|
|
101
|
-
(e != '_posts') and ['.', '_'].include?(e[0..0])
|
108
|
+
(e != '_posts') and ['.', '_'].include?(e[0..0]) unless ['.htaccess'].include?(e)
|
102
109
|
end
|
110
|
+
directories = entries.select { |e| File.directory?(File.join(base, e)) }
|
111
|
+
files = entries.reject { |e| File.directory?(File.join(base, e)) }
|
103
112
|
|
104
113
|
# we need to make sure to process _posts *first* otherwise they
|
105
114
|
# might not be available yet to other templates as {{ site.posts }}
|
@@ -107,23 +116,24 @@ module Jekyll
|
|
107
116
|
entries.delete('_posts')
|
108
117
|
read_posts(dir)
|
109
118
|
end
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
else
|
116
|
-
first3 = File.open(File.join(self.source, dir, f)) { |fd| fd.read(3) }
|
117
|
-
|
118
|
-
if first3 == "---"
|
119
|
-
# file appears to have a YAML header so process it as a page
|
120
|
-
page = Page.new(self.source, dir, f)
|
121
|
-
page.render(self.layouts, site_payload)
|
122
|
-
page.write(self.dest)
|
119
|
+
[directories, files].each do |entries|
|
120
|
+
entries.each do |f|
|
121
|
+
if File.directory?(File.join(base, f))
|
122
|
+
next if self.dest.sub(/\/$/, '') == File.join(base, f)
|
123
|
+
transform_pages(File.join(dir, f))
|
123
124
|
else
|
124
|
-
|
125
|
-
|
126
|
-
|
125
|
+
first3 = File.open(File.join(self.source, dir, f)) { |fd| fd.read(3) }
|
126
|
+
|
127
|
+
if first3 == "---"
|
128
|
+
# file appears to have a YAML header so process it as a page
|
129
|
+
page = Page.new(self.source, dir, f)
|
130
|
+
page.render(self.layouts, site_payload)
|
131
|
+
page.write(self.dest)
|
132
|
+
else
|
133
|
+
# otherwise copy the file without transforming it
|
134
|
+
FileUtils.mkdir_p(File.join(self.dest, dir))
|
135
|
+
FileUtils.cp(File.join(self.source, dir, f), File.join(self.dest, dir, f))
|
136
|
+
end
|
127
137
|
end
|
128
138
|
end
|
129
139
|
end
|
@@ -2,10 +2,22 @@ module Jekyll
|
|
2
2
|
|
3
3
|
class HighlightBlock < Liquid::Block
|
4
4
|
include Liquid::StandardFilters
|
5
|
+
# we need a language, but the linenos argument is optional.
|
6
|
+
SYNTAX = /(\w+)\s?(:?linenos)?\s?/
|
5
7
|
|
6
|
-
def initialize(tag_name,
|
8
|
+
def initialize(tag_name, markup, tokens)
|
7
9
|
super
|
8
|
-
|
10
|
+
if markup =~ SYNTAX
|
11
|
+
@lang = $1
|
12
|
+
if defined? $2
|
13
|
+
# additional options to pass to Albino.
|
14
|
+
@options = { 'O' => 'linenos=inline' }
|
15
|
+
else
|
16
|
+
@options = {}
|
17
|
+
end
|
18
|
+
else
|
19
|
+
raise SyntaxError.new("Syntax Error in 'highlight' - Valid syntax: highlight <lang> [linenos]")
|
20
|
+
end
|
9
21
|
end
|
10
22
|
|
11
23
|
def render(context)
|
@@ -17,7 +29,11 @@ module Jekyll
|
|
17
29
|
end
|
18
30
|
|
19
31
|
def render_pygments(context, code)
|
20
|
-
|
32
|
+
if Jekyll.content_type == :markdown
|
33
|
+
return "\n" + Albino.new(code, @lang).to_s(@options) + "\n"
|
34
|
+
else
|
35
|
+
"<notextile>" + Albino.new(code, @lang).to_s(@options) + "</notextile>"
|
36
|
+
end
|
21
37
|
end
|
22
38
|
|
23
39
|
def render_codehighlighter(context, code)
|
@@ -34,4 +50,4 @@ module Jekyll
|
|
34
50
|
|
35
51
|
end
|
36
52
|
|
37
|
-
Liquid::Template.register_tag('highlight', Jekyll::HighlightBlock)
|
53
|
+
Liquid::Template.register_tag('highlight', Jekyll::HighlightBlock)
|
data/lib/jekyll.rb
CHANGED
@@ -43,15 +43,14 @@ require 'jekyll/tags/include'
|
|
43
43
|
require 'jekyll/albino'
|
44
44
|
|
45
45
|
module Jekyll
|
46
|
-
VERSION = '0.3.0'
|
47
|
-
|
48
46
|
class << self
|
49
|
-
attr_accessor :source, :dest, :lsi, :pygments, :markdown_proc
|
47
|
+
attr_accessor :source, :dest, :lsi, :pygments, :markdown_proc, :content_type, :permalink_style
|
50
48
|
end
|
51
49
|
|
52
50
|
Jekyll.lsi = false
|
53
51
|
Jekyll.pygments = false
|
54
52
|
Jekyll.markdown_proc = Proc.new { |x| Maruku.new(x).to_html }
|
53
|
+
Jekyll.permalink_style = :date
|
55
54
|
|
56
55
|
def self.process(source, dest)
|
57
56
|
require 'classifier' if Jekyll.lsi
|
@@ -60,4 +59,9 @@ module Jekyll
|
|
60
59
|
Jekyll.dest = dest
|
61
60
|
Jekyll::Site.new(source, dest).process
|
62
61
|
end
|
62
|
+
|
63
|
+
def self.version
|
64
|
+
yml = YAML.load(File.read(File.join(File.dirname(__FILE__), *%w[.. VERSION.yml])))
|
65
|
+
"#{yml[:major]}.#{yml[:minor]}.#{yml[:patch]}"
|
66
|
+
end
|
63
67
|
end
|
data/test/helper.rb
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/helper'
|
2
|
+
|
3
|
+
class TestFilters < Test::Unit::TestCase
|
4
|
+
|
5
|
+
class JekyllFilter
|
6
|
+
include Jekyll::Filters
|
7
|
+
end
|
8
|
+
|
9
|
+
def setup
|
10
|
+
@filter = JekyllFilter.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_array_to_sentence_string_with_no_args
|
14
|
+
assert_equal "", @filter.array_to_sentence_string([])
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_array_to_sentence_string_with_one_arg
|
18
|
+
assert_equal "1", @filter.array_to_sentence_string([1])
|
19
|
+
assert_equal "chunky", @filter.array_to_sentence_string(["chunky"])
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_array_to_sentence_string_with_two_args
|
23
|
+
assert_equal "1 and 2", @filter.array_to_sentence_string([1, 2])
|
24
|
+
assert_equal "chunky and bacon", @filter.array_to_sentence_string(["chunky", "bacon"])
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_array_to_sentence_string_with_multiple_args
|
28
|
+
assert_equal "1, 2, 3, and 4", @filter.array_to_sentence_string([1, 2, 3, 4])
|
29
|
+
assert_equal "chunky, bacon, bits, and pieces", @filter.array_to_sentence_string(["chunky", "bacon", "bits", "pieces"])
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_xml_escape_with_ampersands
|
33
|
+
assert_equal "AT&T", @filter.xml_escape("AT&T")
|
34
|
+
assert_equal "<code>command &lt;filename&gt;</code>", @filter.xml_escape("<code>command <filename></code>")
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
data/test/test_generated_site.rb
CHANGED
@@ -3,8 +3,8 @@ require File.dirname(__FILE__) + '/helper'
|
|
3
3
|
class TestGeneratedSite < Test::Unit::TestCase
|
4
4
|
def setup
|
5
5
|
clear_dest
|
6
|
-
source = File.join(File.dirname(__FILE__), *%w[source])
|
7
|
-
@s = Site.new(source, dest_dir)
|
6
|
+
@source = File.join(File.dirname(__FILE__), *%w[source])
|
7
|
+
@s = Site.new(@source, dest_dir)
|
8
8
|
@s.process
|
9
9
|
@index = File.read(File.join(dest_dir, 'index.html'))
|
10
10
|
end
|
@@ -16,6 +16,17 @@ class TestGeneratedSite < Test::Unit::TestCase
|
|
16
16
|
|
17
17
|
def test_post_content_in_index
|
18
18
|
# confirm that the {{ post.content }} is rendered OK
|
19
|
-
|
19
|
+
latest_post = Dir[File.join(@source, '_posts/*')].last
|
20
|
+
post = Post.new(@source, '', File.basename(latest_post))
|
21
|
+
Jekyll.content_type = post.determine_content_type
|
22
|
+
post.transform
|
23
|
+
assert @index.include?(post.content)
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_unpublished_posts_are_hidden
|
27
|
+
published = Dir[File.join(dest_dir, 'publish_test/2008/02/02/*.html')].map {|f| File.basename(f)}
|
28
|
+
|
29
|
+
assert_equal 1, published.size
|
30
|
+
assert_equal "published.html", published.first
|
20
31
|
end
|
21
32
|
end
|
data/test/test_post.rb
CHANGED
@@ -43,7 +43,15 @@ class TestPost < Test::Unit::TestCase
|
|
43
43
|
p.process("2008-12-03-permalinked-post.textile")
|
44
44
|
p.read_yaml(File.join(File.dirname(__FILE__), *%w[source _posts]), "2008-12-03-permalinked-post.textile")
|
45
45
|
|
46
|
-
assert_equal "my_category", p.dir
|
46
|
+
assert_equal "my_category/", p.dir
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_url_respects_permalink
|
50
|
+
p = Post.allocate
|
51
|
+
p.process("2008-12-03-permalinked-post.textile")
|
52
|
+
p.read_yaml(File.join(File.dirname(__FILE__), *%w[source _posts]), "2008-12-03-permalinked-post.textile")
|
53
|
+
|
54
|
+
assert_equal "my_category/permalinked-post", p.url
|
47
55
|
end
|
48
56
|
|
49
57
|
def test_read_yaml
|
@@ -62,6 +70,28 @@ class TestPost < Test::Unit::TestCase
|
|
62
70
|
|
63
71
|
assert_equal "<h1>{{ page.title }}</h1>\n<p>Best <strong>post</strong> ever</p>", p.content
|
64
72
|
end
|
73
|
+
|
74
|
+
def test_published
|
75
|
+
p = Post.new(File.join(File.dirname(__FILE__), *%w[source]), '', "2008-02-02-published.textile")
|
76
|
+
assert_equal true, p.published
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_not_published
|
80
|
+
p = Post.new(File.join(File.dirname(__FILE__), *%w[source]), '', "2008-02-02-not-published.textile")
|
81
|
+
assert_equal false, p.published
|
82
|
+
end
|
83
|
+
|
84
|
+
def test_yaml_category
|
85
|
+
p = Post.new(File.join(File.dirname(__FILE__), *%w[source]), '', "2009-01-27-category.textile")
|
86
|
+
assert p.categories.include?('foo')
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_yaml_categories
|
90
|
+
p = Post.new(File.join(File.dirname(__FILE__), *%w[source]), '', "2009-01-27-categories.textile")
|
91
|
+
assert p.categories.include?('foo')
|
92
|
+
assert p.categories.include?('bar')
|
93
|
+
assert p.categories.include?('baz')
|
94
|
+
end
|
65
95
|
|
66
96
|
def test_render
|
67
97
|
p = Post.new(File.join(File.dirname(__FILE__), *%w[source]), '', "2008-10-18-foo-bar.textile")
|
@@ -88,6 +118,12 @@ class TestPost < Test::Unit::TestCase
|
|
88
118
|
assert_equal "<<< <p>url: /2008/11/21/complex.html<br />\ndate: #{Time.parse("2008-11-21")}<br />\nid: /2008/11/21/complex</p> >>>", p.output
|
89
119
|
end
|
90
120
|
|
121
|
+
def test_categories_and_topics
|
122
|
+
p = Post.new(File.join(File.dirname(__FILE__), *%w[source]), 'foo', 'bar/2008-12-12-topical-post.textile')
|
123
|
+
assert_equal ['foo'], p.categories
|
124
|
+
assert_equal ['bar'], p.topics
|
125
|
+
end
|
126
|
+
|
91
127
|
def test_include
|
92
128
|
Jekyll.source = File.join(File.dirname(__FILE__), *%w[source])
|
93
129
|
p = Post.new(File.join(File.dirname(__FILE__), *%w[source]), '', "2008-12-13-include.markdown")
|
@@ -96,4 +132,4 @@ class TestPost < Test::Unit::TestCase
|
|
96
132
|
|
97
133
|
assert_equal "<<< <hr />\n<p>Tom Preston-Werner github.com/mojombo</p>\n\n<p>This <em>is</em> cool</p> >>>", p.output
|
98
134
|
end
|
99
|
-
end
|
135
|
+
end
|
data/test/test_site.rb
CHANGED
@@ -2,8 +2,8 @@ require File.dirname(__FILE__) + '/helper'
|
|
2
2
|
|
3
3
|
class TestSite < Test::Unit::TestCase
|
4
4
|
def setup
|
5
|
-
source = File.join(File.dirname(__FILE__), *%w[source])
|
6
|
-
@s = Site.new(source, dest_dir)
|
5
|
+
@source = File.join(File.dirname(__FILE__), *%w[source])
|
6
|
+
@s = Site.new(@source, dest_dir)
|
7
7
|
end
|
8
8
|
|
9
9
|
def test_site_init
|
@@ -18,13 +18,19 @@ class TestSite < Test::Unit::TestCase
|
|
18
18
|
|
19
19
|
def test_read_posts
|
20
20
|
@s.read_posts('')
|
21
|
-
|
22
|
-
assert_equal
|
21
|
+
posts = Dir[File.join(@source, '_posts/*')]
|
22
|
+
assert_equal posts.size - 1, @s.posts.size
|
23
23
|
end
|
24
24
|
|
25
|
-
def
|
25
|
+
def test_site_payload
|
26
26
|
clear_dest
|
27
|
-
|
28
27
|
@s.process
|
28
|
+
|
29
|
+
posts = Dir[File.join(@source, "**", "_posts/*")]
|
30
|
+
categories = %w(bar baz category foo z_category publish_test).sort
|
31
|
+
|
32
|
+
assert_equal posts.size - 1, @s.posts.size
|
33
|
+
assert_equal categories, @s.categories.keys.sort
|
34
|
+
assert_equal 3, @s.categories['foo'].size
|
29
35
|
end
|
30
36
|
end
|
data/test/test_tags.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/helper'
|
2
|
+
|
3
|
+
class TestTags < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@content = <<CONTENT
|
7
|
+
---
|
8
|
+
layout: post
|
9
|
+
title: This is a test
|
10
|
+
|
11
|
+
---
|
12
|
+
This document results in a markdown error with maruku
|
13
|
+
{% highlight ruby %}
|
14
|
+
puts "hi"
|
15
|
+
|
16
|
+
puts "bye"
|
17
|
+
{% endhighlight %}
|
18
|
+
|
19
|
+
CONTENT
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_markdown_with_pygments_line_handling
|
23
|
+
Jekyll.pygments = true
|
24
|
+
Jekyll.content_type = :markdown
|
25
|
+
|
26
|
+
result = Liquid::Template.parse(@content).render({}, [Jekyll::Filters])
|
27
|
+
result = Jekyll.markdown_proc.call(result)
|
28
|
+
assert_no_match(/markdown\-html\-error/,result)
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qrush-jekyll
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Preston-Werner
|
@@ -9,8 +9,8 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
13
|
-
default_executable:
|
12
|
+
date: 2009-02-03 00:00:00 -08:00
|
13
|
+
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: RedCloth
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
22
|
+
version: 4.0.4
|
23
23
|
version:
|
24
24
|
- !ruby/object:Gem::Dependency
|
25
25
|
name: liquid
|
@@ -28,7 +28,7 @@ dependencies:
|
|
28
28
|
requirements:
|
29
29
|
- - ">="
|
30
30
|
- !ruby/object:Gem::Version
|
31
|
-
version:
|
31
|
+
version: 1.9.0
|
32
32
|
version:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: classifier
|
@@ -37,7 +37,7 @@ dependencies:
|
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.3.1
|
41
41
|
version:
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: maruku
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version:
|
49
|
+
version: 0.5.9
|
50
50
|
version:
|
51
51
|
- !ruby/object:Gem::Dependency
|
52
52
|
name: directory_watcher
|
@@ -55,7 +55,7 @@ dependencies:
|
|
55
55
|
requirements:
|
56
56
|
- - ">="
|
57
57
|
- !ruby/object:Gem::Version
|
58
|
-
version:
|
58
|
+
version: 1.1.1
|
59
59
|
version:
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: open4
|
@@ -64,39 +64,29 @@ dependencies:
|
|
64
64
|
requirements:
|
65
65
|
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
67
|
+
version: 0.9.6
|
68
68
|
version:
|
69
|
-
|
70
|
-
|
71
|
-
version_requirement:
|
72
|
-
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: 1.8.0
|
77
|
-
version:
|
78
|
-
description:
|
79
|
-
email:
|
80
|
-
- tom@mojombo.com
|
69
|
+
description: Jekyll is a simple, blog aware, static site generator.
|
70
|
+
email: tom@mojombo.com
|
81
71
|
executables:
|
82
72
|
- jekyll
|
83
73
|
extensions: []
|
84
74
|
|
85
|
-
extra_rdoc_files:
|
86
|
-
|
87
|
-
- Manifest.txt
|
75
|
+
extra_rdoc_files: []
|
76
|
+
|
88
77
|
files:
|
89
78
|
- History.txt
|
90
|
-
- Manifest.txt
|
91
79
|
- README.textile
|
92
|
-
-
|
80
|
+
- VERSION.yml
|
93
81
|
- bin/jekyll
|
94
|
-
- jekyll
|
95
|
-
- lib/jekyll.rb
|
82
|
+
- lib/jekyll
|
96
83
|
- lib/jekyll/albino.rb
|
84
|
+
- lib/jekyll/converters
|
97
85
|
- lib/jekyll/converters/csv.rb
|
98
86
|
- lib/jekyll/converters/mephisto.rb
|
99
87
|
- lib/jekyll/converters/mt.rb
|
88
|
+
- lib/jekyll/converters/textpattern.rb
|
89
|
+
- lib/jekyll/converters/typo.rb
|
100
90
|
- lib/jekyll/converters/wordpress.rb
|
101
91
|
- lib/jekyll/convertible.rb
|
102
92
|
- lib/jekyll/core_ext.rb
|
@@ -105,29 +95,91 @@ files:
|
|
105
95
|
- lib/jekyll/page.rb
|
106
96
|
- lib/jekyll/post.rb
|
107
97
|
- lib/jekyll/site.rb
|
98
|
+
- lib/jekyll/tags
|
108
99
|
- lib/jekyll/tags/highlight.rb
|
109
100
|
- lib/jekyll/tags/include.rb
|
101
|
+
- lib/jekyll.rb
|
102
|
+
- test/dest
|
103
|
+
- test/dest/2008
|
104
|
+
- test/dest/2008/10
|
105
|
+
- test/dest/2008/10/18
|
106
|
+
- test/dest/2008/10/18/foo-bar.html
|
107
|
+
- test/dest/2008/11
|
108
|
+
- test/dest/2008/11/21
|
109
|
+
- test/dest/2008/11/21/complex.html
|
110
|
+
- test/dest/2008/12
|
111
|
+
- test/dest/2008/12/13
|
112
|
+
- test/dest/2008/12/13/include.html
|
113
|
+
- test/dest/_posts
|
114
|
+
- test/dest/_posts/2008-10-18-foo-bar.html
|
115
|
+
- test/dest/_posts/2008-11-21-complex.html
|
116
|
+
- test/dest/_posts/2008-12-03-permalinked-post.html
|
117
|
+
- test/dest/_posts/2008-12-13-include.html
|
118
|
+
- test/dest/category
|
119
|
+
- test/dest/category/2008
|
120
|
+
- test/dest/category/2008/09
|
121
|
+
- test/dest/category/2008/09/23
|
122
|
+
- test/dest/category/2008/09/23/categories.html
|
123
|
+
- test/dest/category/_posts
|
124
|
+
- test/dest/category/_posts/2008-9-23-categories.html
|
125
|
+
- test/dest/css
|
126
|
+
- test/dest/css/screen.css
|
127
|
+
- test/dest/foo
|
128
|
+
- test/dest/foo/2008
|
129
|
+
- test/dest/foo/2008/12
|
130
|
+
- test/dest/foo/2008/12/12
|
131
|
+
- test/dest/foo/2008/12/12/topical-post.html
|
132
|
+
- test/dest/foo/_posts
|
133
|
+
- test/dest/foo/_posts/bar
|
134
|
+
- test/dest/foo/_posts/bar/2008-12-12-topical-post.html
|
135
|
+
- test/dest/index.html
|
136
|
+
- test/dest/my_category
|
137
|
+
- test/dest/my_category/permalinked-post
|
138
|
+
- test/dest/z_category
|
139
|
+
- test/dest/z_category/2008
|
140
|
+
- test/dest/z_category/2008/09
|
141
|
+
- test/dest/z_category/2008/09/23
|
142
|
+
- test/dest/z_category/2008/09/23/categories.html
|
143
|
+
- test/dest/z_category/_posts
|
144
|
+
- test/dest/z_category/_posts/2008-9-23-categories.html
|
110
145
|
- test/helper.rb
|
146
|
+
- test/source
|
147
|
+
- test/source/_includes
|
111
148
|
- test/source/_includes/sig.markdown
|
149
|
+
- test/source/_layouts
|
112
150
|
- test/source/_layouts/default.html
|
113
151
|
- test/source/_layouts/simple.html
|
152
|
+
- test/source/_posts
|
114
153
|
- test/source/_posts/2008-10-18-foo-bar.textile
|
115
154
|
- test/source/_posts/2008-11-21-complex.textile
|
116
155
|
- test/source/_posts/2008-12-03-permalinked-post.textile
|
117
156
|
- test/source/_posts/2008-12-13-include.markdown
|
157
|
+
- test/source/category
|
158
|
+
- test/source/category/_posts
|
159
|
+
- test/source/category/_posts/2008-9-23-categories.textile
|
160
|
+
- test/source/css
|
118
161
|
- test/source/css/screen.css
|
162
|
+
- test/source/foo
|
163
|
+
- test/source/foo/_posts
|
164
|
+
- test/source/foo/_posts/bar
|
165
|
+
- test/source/foo/_posts/bar/2008-12-12-topical-post.textile
|
119
166
|
- test/source/index.html
|
167
|
+
- test/source/z_category
|
168
|
+
- test/source/z_category/_posts
|
169
|
+
- test/source/z_category/_posts/2008-9-23-categories.textile
|
120
170
|
- test/suite.rb
|
171
|
+
- test/test_filters.rb
|
121
172
|
- test/test_generated_site.rb
|
122
173
|
- test/test_jekyll.rb
|
123
174
|
- test/test_post.rb
|
124
175
|
- test/test_site.rb
|
176
|
+
- test/test_tags.rb
|
125
177
|
has_rdoc: true
|
126
|
-
homepage:
|
178
|
+
homepage: http://github.com/mojombo/jekyll
|
127
179
|
post_install_message:
|
128
180
|
rdoc_options:
|
129
|
-
- --
|
130
|
-
-
|
181
|
+
- --inline-source
|
182
|
+
- --charset=UTF-8
|
131
183
|
require_paths:
|
132
184
|
- lib
|
133
185
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -149,8 +201,5 @@ rubygems_version: 1.2.0
|
|
149
201
|
signing_key:
|
150
202
|
specification_version: 2
|
151
203
|
summary: Jekyll is a simple, blog aware, static site generator.
|
152
|
-
test_files:
|
153
|
-
|
154
|
-
- test/test_jekyll.rb
|
155
|
-
- test/test_post.rb
|
156
|
-
- test/test_site.rb
|
204
|
+
test_files: []
|
205
|
+
|
data/Manifest.txt
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
History.txt
|
2
|
-
Manifest.txt
|
3
|
-
README.textile
|
4
|
-
Rakefile
|
5
|
-
bin/jekyll
|
6
|
-
jekyll.gemspec
|
7
|
-
lib/jekyll.rb
|
8
|
-
lib/jekyll/albino.rb
|
9
|
-
lib/jekyll/converters/csv.rb
|
10
|
-
lib/jekyll/converters/mephisto.rb
|
11
|
-
lib/jekyll/converters/mt.rb
|
12
|
-
lib/jekyll/converters/typo.rb
|
13
|
-
lib/jekyll/converters/wordpress.rb
|
14
|
-
lib/jekyll/convertible.rb
|
15
|
-
lib/jekyll/core_ext.rb
|
16
|
-
lib/jekyll/filters.rb
|
17
|
-
lib/jekyll/layout.rb
|
18
|
-
lib/jekyll/page.rb
|
19
|
-
lib/jekyll/post.rb
|
20
|
-
lib/jekyll/site.rb
|
21
|
-
lib/jekyll/tags/highlight.rb
|
22
|
-
lib/jekyll/tags/include.rb
|
23
|
-
test/helper.rb
|
24
|
-
test/source/_includes/sig.markdown
|
25
|
-
test/source/_layouts/default.html
|
26
|
-
test/source/_layouts/simple.html
|
27
|
-
test/source/_posts/2008-10-18-foo-bar.textile
|
28
|
-
test/source/_posts/2008-11-21-complex.textile
|
29
|
-
test/source/_posts/2008-12-03-permalinked-post.textile
|
30
|
-
test/source/_posts/2008-12-13-include.markdown
|
31
|
-
test/source/css/screen.css
|
32
|
-
test/source/index.html
|
33
|
-
test/suite.rb
|
34
|
-
test/test_filters.rb
|
35
|
-
test/test_generated_site.rb
|
36
|
-
test/test_jekyll.rb
|
37
|
-
test/test_post.rb
|
38
|
-
test/test_site.rb
|
data/Rakefile
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'hoe'
|
3
|
-
require 'lib/jekyll'
|
4
|
-
|
5
|
-
Hoe.new('jekyll', Jekyll::VERSION) do |p|
|
6
|
-
p.developer('Tom Preston-Werner', 'tom@mojombo.com')
|
7
|
-
p.summary = "Jekyll is a simple, blog aware, static site generator."
|
8
|
-
p.extra_deps = ['RedCloth', 'liquid', 'classifier', 'maruku', 'directory_watcher', 'open4']
|
9
|
-
end
|
10
|
-
|
11
|
-
desc "Open an irb session preloaded with this library"
|
12
|
-
task :console do
|
13
|
-
sh "irb -rubygems -r ./lib/jekyll.rb"
|
14
|
-
end
|
15
|
-
|
16
|
-
namespace :convert do
|
17
|
-
desc "Migrate from mephisto in the current directory"
|
18
|
-
task :mephisto do
|
19
|
-
sh %q(ruby -r './lib/jekyll/converters/mephisto' -e 'Jekyll::Mephisto.postgres(:database => "#{ENV["DB"]}")')
|
20
|
-
end
|
21
|
-
desc "Migrate from Movable Type in the current directory"
|
22
|
-
task :mt do
|
23
|
-
sh %q(ruby -r './lib/jekyll/converters/mt' -e 'Jekyll::MT.process("#{ENV["DB"]}", "#{ENV["USER"]}", "#{ENV["PASS"]}")')
|
24
|
-
end
|
25
|
-
desc "Migrate from Typo in the current directory"
|
26
|
-
task :typo do
|
27
|
-
sh %q(ruby -r './lib/jekyll/converters/typo' -e 'Jekyll::Typo.process("#{ENV["DB"]}", "#{ENV["USER"]}", "#{ENV["PASS"]}")')
|
28
|
-
end
|
29
|
-
end
|
data/jekyll.gemspec
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |s|
|
2
|
-
s.name = %q{jekyll}
|
3
|
-
s.version = "0.3.0.1"
|
4
|
-
|
5
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
6
|
-
s.authors = ["Tom Preston-Werner"]
|
7
|
-
s.date = %q{2008-12-24}
|
8
|
-
s.default_executable = %q{jekyll}
|
9
|
-
s.email = ["tom@mojombo.com"]
|
10
|
-
s.executables = ["jekyll"]
|
11
|
-
s.extra_rdoc_files = ["History.txt", "Manifest.txt"]
|
12
|
-
s.files = ["History.txt", "Manifest.txt", "README.textile", "Rakefile", "bin/jekyll", "jekyll.gemspec", "lib/jekyll.rb", "lib/jekyll/albino.rb", "lib/jekyll/converters/csv.rb", "lib/jekyll/converters/mephisto.rb", "lib/jekyll/converters/mt.rb", "lib/jekyll/converters/wordpress.rb", "lib/jekyll/convertible.rb", "lib/jekyll/core_ext.rb", "lib/jekyll/filters.rb", "lib/jekyll/layout.rb", "lib/jekyll/page.rb", "lib/jekyll/post.rb", "lib/jekyll/site.rb", "lib/jekyll/tags/highlight.rb", "lib/jekyll/tags/include.rb", "test/helper.rb", "test/source/_includes/sig.markdown", "test/source/_layouts/default.html", "test/source/_layouts/simple.html", "test/source/_posts/2008-10-18-foo-bar.textile", "test/source/_posts/2008-11-21-complex.textile", "test/source/_posts/2008-12-03-permalinked-post.textile", "test/source/_posts/2008-12-13-include.markdown", "test/source/css/screen.css", "test/source/index.html", "test/suite.rb", "test/test_generated_site.rb", "test/test_jekyll.rb", "test/test_post.rb", "test/test_site.rb"]
|
13
|
-
s.has_rdoc = true
|
14
|
-
s.rdoc_options = ["--main", "README.txt"]
|
15
|
-
s.require_paths = ["lib"]
|
16
|
-
s.rubyforge_project = %q{jekyll}
|
17
|
-
s.rubygems_version = %q{1.3.0}
|
18
|
-
s.summary = %q{Jekyll is a simple, blog aware, static site generator.}
|
19
|
-
s.test_files = ["test/test_generated_site.rb", "test/test_jekyll.rb", "test/test_post.rb", "test/test_site.rb"]
|
20
|
-
|
21
|
-
if s.respond_to? :specification_version then
|
22
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
23
|
-
s.specification_version = 2
|
24
|
-
|
25
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
26
|
-
s.add_runtime_dependency(%q<RedCloth>, [">= 0"])
|
27
|
-
s.add_runtime_dependency(%q<liquid>, [">= 0"])
|
28
|
-
s.add_runtime_dependency(%q<classifier>, [">= 0"])
|
29
|
-
s.add_runtime_dependency(%q<maruku>, [">= 0"])
|
30
|
-
s.add_runtime_dependency(%q<directory_watcher>, [">= 0"])
|
31
|
-
s.add_runtime_dependency(%q<open4>, [">= 0"])
|
32
|
-
s.add_development_dependency(%q<hoe>, [">= 1.8.0"])
|
33
|
-
else
|
34
|
-
s.add_dependency(%q<RedCloth>, [">= 0"])
|
35
|
-
s.add_dependency(%q<liquid>, [">= 0"])
|
36
|
-
s.add_dependency(%q<classifier>, [">= 0"])
|
37
|
-
s.add_dependency(%q<maruku>, [">= 0"])
|
38
|
-
s.add_dependency(%q<directory_watcher>, [">= 0"])
|
39
|
-
s.add_dependency(%q<open4>, [">= 0"])
|
40
|
-
s.add_dependency(%q<hoe>, [">= 1.8.0"])
|
41
|
-
end
|
42
|
-
else
|
43
|
-
s.add_dependency(%q<RedCloth>, [">= 0"])
|
44
|
-
s.add_dependency(%q<liquid>, [">= 0"])
|
45
|
-
s.add_dependency(%q<classifier>, [">= 0"])
|
46
|
-
s.add_dependency(%q<maruku>, [">= 0"])
|
47
|
-
s.add_dependency(%q<directory_watcher>, [">= 0"])
|
48
|
-
s.add_dependency(%q<open4>, [">= 0"])
|
49
|
-
s.add_dependency(%q<hoe>, [">= 1.8.0"])
|
50
|
-
end
|
51
|
-
end
|