jekyll 0.4.1 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of jekyll might be problematic. Click here for more details.
- data/History.txt +31 -1
- data/README.textile +23 -457
- data/Rakefile +91 -0
- data/VERSION.yml +2 -2
- data/bin/jekyll +61 -57
- data/lib/jekyll.rb +48 -32
- data/lib/jekyll/albino.rb +13 -7
- data/lib/jekyll/converters/mephisto.rb +8 -8
- data/lib/jekyll/converters/mt.rb +8 -8
- data/lib/jekyll/converters/textpattern.rb +4 -4
- data/lib/jekyll/converters/typo.rb +8 -8
- data/lib/jekyll/converters/wordpress.rb +1 -2
- data/lib/jekyll/convertible.rb +33 -22
- data/lib/jekyll/core_ext.rb +5 -5
- data/lib/jekyll/filters.rb +15 -7
- data/lib/jekyll/layout.rb +9 -6
- data/lib/jekyll/page.rb +13 -10
- data/lib/jekyll/post.rb +108 -39
- data/lib/jekyll/site.rb +121 -51
- data/lib/jekyll/tags/highlight.rb +12 -9
- data/lib/jekyll/tags/include.rb +5 -5
- data/test/helper.rb +20 -6
- 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/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-03-12-hash-#1.markdown +6 -0
- data/test/test_filters.rb +39 -27
- data/test/test_generated_site.rb +32 -16
- data/test/test_post.rb +258 -102
- data/test/test_site.rb +60 -28
- data/test/test_tags.rb +103 -18
- metadata +25 -70
- data/test/dest/2008/10/18/foo-bar.html +0 -28
- data/test/dest/2008/11/21/complex.html +0 -29
- data/test/dest/2008/12/13/include.html +0 -30
- data/test/dest/_posts/2008-10-18-foo-bar.html +0 -28
- data/test/dest/_posts/2008-11-21-complex.html +0 -29
- data/test/dest/_posts/2008-12-03-permalinked-post.html +0 -2
- data/test/dest/_posts/2008-12-13-include.html +0 -30
- data/test/dest/category/2008/09/23/categories.html +0 -27
- data/test/dest/category/_posts/2008-9-23-categories.html +0 -27
- data/test/dest/css/screen.css +0 -76
- data/test/dest/foo/2008/12/12/topical-post.html +0 -28
- data/test/dest/foo/_posts/bar/2008-12-12-topical-post.html +0 -28
- data/test/dest/index.html +0 -60
- data/test/dest/my_category/permalinked-post +0 -2
- data/test/dest/z_category/2008/09/23/categories.html +0 -27
- data/test/dest/z_category/_posts/2008-9-23-categories.html +0 -27
- data/test/test_jekyll.rb +0 -0
data/History.txt
CHANGED
@@ -1,4 +1,34 @@
|
|
1
|
-
==
|
1
|
+
== 0.5.1
|
2
|
+
* Major Enhancements
|
3
|
+
* Next/previous posts in site payload [github.com/pantulis, github.com/tomo]
|
4
|
+
* Permalink templating system
|
5
|
+
* Moved most of the README out to the GitHub wiki
|
6
|
+
* Exclude option in configuration so specified files won't be brought over with generated site [github.com/duritong]
|
7
|
+
* Bug Fixes
|
8
|
+
* Making sure config.yaml references are all gone, using only config.yml
|
9
|
+
* Fixed syntax highlighting breaking for UTF-8 code [github.com/henrik]
|
10
|
+
* Worked around RDiscount bug that prevents Markdown from getting parsed after highlight [github.com/henrik]
|
11
|
+
* CGI escaped post titles [github.com/Chrononaut]
|
12
|
+
|
13
|
+
== 0.5.0 / 2009-04-07
|
14
|
+
* Minor Enhancements
|
15
|
+
* Ability to set post categories via YAML [github.com/qrush]
|
16
|
+
* Ability to set prevent a post from publishing via YAML [github.com/qrush]
|
17
|
+
* Add textilize filter [github.com/willcodeforfoo]
|
18
|
+
* Add 'pretty' permalink style for wordpress-like urls [github.com/dysinger]
|
19
|
+
* Made it possible to enter categories from YAML as an array [github.com/Chrononaut]
|
20
|
+
* Ignore Emacs autosave files [github.com/Chrononaut]
|
21
|
+
* Bug Fixes
|
22
|
+
* Use block syntax of popen4 to ensure that subprocesses are properly disposed [github.com/jqr]
|
23
|
+
* Close open4 streams to prevent zombies [github.com/rtomayko]
|
24
|
+
* Only query required fields from the WP Database [github.com/ariejan]
|
25
|
+
* Prevent _posts from being copied to the destination directory [github.com/bdimcheff]
|
26
|
+
* Refactors
|
27
|
+
* Factored the filtering code into a method [github.com/Chrononaut]
|
28
|
+
* Fix tests and convert to Shoulda [github.com/qrush, github.com/technicalpickles]
|
29
|
+
* Add Cucumber acceptance test suite [github.com/qrush, github.com/technicalpickles]
|
30
|
+
|
31
|
+
== 0.4.1
|
2
32
|
* Minor Enhancements
|
3
33
|
* Changed date format on wordpress converter (zeropadding) [github.com/dysinger]
|
4
34
|
* Bug Fixes
|
data/README.textile
CHANGED
@@ -1,453 +1,32 @@
|
|
1
1
|
h1. Jekyll
|
2
2
|
|
3
|
-
|
4
|
-
directory (representing the raw form of a website), runs it through Textile or
|
5
|
-
Markdown and Liquid converters, and spits out a complete, static website
|
6
|
-
suitable for serving with Apache or your favorite web server. Visit
|
7
|
-
"http://tom.preston-werner.com":http://tom.preston-werner.com to see an
|
8
|
-
example of a Jekyll generated blog.
|
3
|
+
By Tom Preston-Werner, Nick Quaranto, and many awesome contributors!
|
9
4
|
|
10
|
-
|
11
|
-
"TPW":http://github.com/mojombo/tpw repo in a new browser window. I'll be
|
12
|
-
referencing the code there.
|
5
|
+
Jekyll is a simple, blog aware, static site generator. It takes a template directory (representing the raw form of a website), runs it through Textile or Markdown and Liquid converters, and spits out a complete, static website suitable for serving with Apache or your favorite web server. This is also the engine behind "GitHub Pages":http://pages.github.com, which you can use to host your project's page or blog right here from GitHub.
|
13
6
|
|
14
|
-
|
15
|
-
"index.html":http://github.com/mojombo/tpw/tree/master/index.html. This file
|
16
|
-
represents the homepage of the site. At the top of the file is a chunk of YAML
|
17
|
-
that contains metadata about the file. This data tells Jekyll what layout to
|
18
|
-
give the file, what the page's title should be, etc. In this case, I specify
|
19
|
-
that the "default" template should be used. You can find the layout files in
|
20
|
-
the "_layouts":http://github.com/mojombo/tpw/tree/master/_layouts directory.
|
21
|
-
If you open
|
22
|
-
"default.html":http://github.com/mojombo/tpw/tree/master/_layouts/default.html
|
23
|
-
you can see that the homepage is constructed by wrapping index.html with this
|
24
|
-
layout.
|
7
|
+
h2. Getting Started
|
25
8
|
|
26
|
-
|
27
|
-
"
|
28
|
-
|
29
|
-
|
30
|
-
various data about my site. A reverse chronological list of all my blog posts
|
31
|
-
can be found in <code>site.posts</code>. Each post, in turn, contains various
|
32
|
-
fields such as <code>title</code> and <code>date</code>.
|
9
|
+
* "Install":http://wiki.github.com/mojombo/jekyll/install the gem
|
10
|
+
* Read up about its "Usage":http://wiki.github.com/mojombo/jekyll/usage and "Configuration":http://wiki.github.com/mojombo/jekyll/configuration
|
11
|
+
* Take a gander at some existing "Sites":http://wiki.github.com/mojombo/jekyll/sites
|
12
|
+
* Fork and "Contribute":http://wiki.github.com/mojombo/jekyll/contribute your own modifications
|
33
13
|
|
34
|
-
|
35
|
-
"_posts":http://github.com/mojombo/tpw/tree/master/_posts directory found in
|
36
|
-
subdirectories below the root.
|
37
|
-
Each post's filename contains (by default) the publishing date and slug (what shows up in the
|
38
|
-
URL) that the final HTML file should have. Open up the file corresponding to a
|
39
|
-
blog post:
|
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.
|
41
|
-
GitHub renders textile files by default, so to better understand the file,
|
42
|
-
click on the
|
43
|
-
"raw":http://github.com/mojombo/tpw/tree/master/_posts/2008-11-17-blogging-like-a-hacker.textile?raw=true
|
44
|
-
view to see the original file. Here I've specified the <code>post</code>
|
45
|
-
layout. If you look at that file you'll see an example of a nested layout.
|
46
|
-
Layouts can contain other layouts allowing you a great deal of flexibility in
|
47
|
-
how pages are assembled. In my case I use a nested layout in order to show
|
48
|
-
related posts for each blog entry. The YAML also specifies the post's title
|
49
|
-
which is then embedded in the post's body via Liquid.
|
14
|
+
h2. Diving In
|
50
15
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
16
|
+
* "Migrate":http://wiki.github.com/mojombo/jekyll/blog-migrations from your previous system
|
17
|
+
* Learn how the "YAML Front Matter":http://wiki.github.com/mojombo/jekyll/yaml-front-matter works
|
18
|
+
* Put information on your site with "Template Data":http://wiki.github.com/mojombo/jekyll/template-data
|
19
|
+
* Customize the "Permalinks":http://wiki.github.com/mojombo/jekyll/permalinks your posts are generated with
|
20
|
+
* Use the built-in "Liquid Extensions":http://wiki.github.com/mojombo/jekyll/liquid-extensions to make your life easier
|
55
21
|
|
56
|
-
|
57
|
-
found within. A post that appears in the directory foo/bar/_posts is placed in
|
58
|
-
the categories 'foo' and 'bar'. By selecting posts from particular categories
|
59
|
-
in your Liquid templates, you will be able to host multiple blogs within a
|
60
|
-
site.
|
22
|
+
h2. Dependencies
|
61
23
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
functionality that I've needed. As time goes on I'd like to see the project
|
69
|
-
mature and support additional features. If you end up using Jekyll for your
|
70
|
-
own blog, drop me a line and let me know what you'd like to see in future
|
71
|
-
versions. Better yet, fork the project over at GitHub and hack in the features
|
72
|
-
yourself!
|
73
|
-
|
74
|
-
h2. Example Proto-Site
|
75
|
-
|
76
|
-
My own personal site/blog is generated with Jekyll.
|
77
|
-
|
78
|
-
The proto-site repo
|
79
|
-
("http://github.com/mojombo/tpw":http://github.com/mojombo/tpw) is converted
|
80
|
-
into the actual site
|
81
|
-
("http://tom.preston-werner.com/":http://tom.preston-werner.com)
|
82
|
-
|
83
|
-
h2. Install
|
84
|
-
|
85
|
-
The best way to install Jekyll is via RubyGems:
|
86
|
-
|
87
|
-
$ sudo gem install mojombo-jekyll -s http://gems.github.com/
|
88
|
-
|
89
|
-
Jekyll requires the gems `directory_watcher`, `liquid`, `open4`,
|
90
|
-
and `maruku` (for markdown support). These are automatically
|
91
|
-
installed by the gem install command.
|
92
|
-
|
93
|
-
Maruku comes with optional support for LaTeX to PNG rendering via
|
94
|
-
"blahtex":http://gva.noekeon.org/blahtexml/ (Version 0.6) which must be in
|
95
|
-
your $PATH along with `dvips`.
|
96
|
-
|
97
|
-
(NOTE: the version of maruku I am using is `remi-maruku` on GitHub as it
|
98
|
-
does not assume a fixed location for `dvips`.)
|
99
|
-
|
100
|
-
h2. Run
|
101
|
-
|
102
|
-
$ cd /path/to/proto/site
|
103
|
-
$ jekyll
|
104
|
-
|
105
|
-
This will generate the site and place it in /path/to/proto/site/_site. If
|
106
|
-
you'd like the generated site placed somewhere else:
|
107
|
-
|
108
|
-
$ jekyll /path/to/place/generated/site
|
109
|
-
|
110
|
-
And if you don't want to be in the proto site root to run Jekyll:
|
111
|
-
|
112
|
-
$ jekyll /path/to/proto/site /path/to/place/generated/site
|
113
|
-
|
114
|
-
h2. Run Options
|
115
|
-
|
116
|
-
There is an autobuild feature that will regenerate your site if any of the
|
117
|
-
files change. The autobuild feature can be used on any of the invocations:
|
118
|
-
|
119
|
-
$ jekyll --auto
|
120
|
-
|
121
|
-
By default, the "related posts" functionality will produce crappy results.
|
122
|
-
In order to get high quality results with a true LSI algorithm, you must
|
123
|
-
enable it (it may take some time to run if you have many posts):
|
124
|
-
|
125
|
-
$ jekyll --lsi
|
126
|
-
|
127
|
-
For static code highlighting, you can install Pygments (see below) and then
|
128
|
-
use that to make your code blocks look pretty. To activate Pygments support
|
129
|
-
during the conversion:
|
130
|
-
|
131
|
-
$ jekyll --pygments
|
132
|
-
|
133
|
-
By default, Jekyll uses "Maruku":http://maruku.rubyforge.org (pure Ruby) for
|
134
|
-
Markdown support. If you'd like to use RDiscount (faster, but requires
|
135
|
-
compilation), you must install it (gem install rdiscount) and then you can
|
136
|
-
have it used instead:
|
137
|
-
|
138
|
-
$ jekyll --rdiscount
|
139
|
-
|
140
|
-
When previewing complex sites locally, simply opening the site in a web
|
141
|
-
browser (using file://) can cause problems with links that are relative to
|
142
|
-
the site root (e.g., "/stylesheets/style.css"). To get around this, Jekyll
|
143
|
-
can launch a simple WEBrick server (works well in conjunction with --auto).
|
144
|
-
Default port is 4000:
|
145
|
-
|
146
|
-
$ jekyll --server [PORT]
|
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
|
-
|
159
|
-
h2. Data
|
160
|
-
|
161
|
-
Jekyll traverses your site looking for files to process. Any files with YAML
|
162
|
-
front matter (see below) are subject to processing. For each of these files,
|
163
|
-
Jekyll makes a variety of data available to the pages via the Liquid
|
164
|
-
templating system. The following is a reference of the available data.
|
165
|
-
|
166
|
-
h3. Global
|
167
|
-
|
168
|
-
site
|
169
|
-
Sitewide information.
|
170
|
-
|
171
|
-
page
|
172
|
-
For Posts, this is the union of the data in the YAML front matter and the
|
173
|
-
computed data (such as URL and date). For regular pages, this is just the
|
174
|
-
YAML front matter.
|
175
|
-
|
176
|
-
content
|
177
|
-
In layout files, this contains the content of the subview(s). In Posts or
|
178
|
-
Pages, this is undefined.
|
179
|
-
|
180
|
-
h3. Site
|
181
|
-
|
182
|
-
site.time
|
183
|
-
The current Time (when you run the jekyll command).
|
184
|
-
|
185
|
-
site.posts
|
186
|
-
A reverse chronological list of all Posts.
|
187
|
-
|
188
|
-
site.related_posts
|
189
|
-
If the page being processed is a Post, this contains a list of up to ten
|
190
|
-
related Posts. By default, these are low quality but fast to compute. For
|
191
|
-
high quality but slow to compute results, run the jekyll command with the
|
192
|
-
--lsi (latent semantic indexing) option.
|
193
|
-
|
194
|
-
site.categories.CATEGORY
|
195
|
-
The list of all Posts in category CATEGORY.
|
196
|
-
|
197
|
-
h3. Post
|
198
|
-
|
199
|
-
post.title
|
200
|
-
The title of the Post.
|
201
|
-
|
202
|
-
post.url
|
203
|
-
The URL of the Post without the domain.
|
204
|
-
e.g. /2008/12/14/my-post.html
|
205
|
-
|
206
|
-
post.date
|
207
|
-
The Date assigned to the Post.
|
208
|
-
|
209
|
-
post.id
|
210
|
-
An identifier unique to the Post (useful in RSS feeds).
|
211
|
-
e.g. /2008/12/14/my-post
|
212
|
-
|
213
|
-
post.categories
|
214
|
-
The list of categories to which this post belongs. Categories are
|
215
|
-
derived from the directory structure above the _posts directory. For
|
216
|
-
example, a post at /work/code/_posts/2008-12-24-closures.textile
|
217
|
-
would have this field set to ['work', 'code'].
|
218
|
-
|
219
|
-
post.topics
|
220
|
-
The list of topics for this Post. Topics are derived from the directory
|
221
|
-
structure beneath the _posts directory. For example, a post at
|
222
|
-
/_posts/music/metal/2008-12-24-metalocalypse.textile would have this field
|
223
|
-
set to ['music', 'metal'].
|
224
|
-
|
225
|
-
post.content
|
226
|
-
The content of the Post.
|
227
|
-
|
228
|
-
h2. YAML Front Matter
|
229
|
-
|
230
|
-
Any files that contain a YAML front matter block will be processed by Jekyll
|
231
|
-
as special files. The front matter must be the first thing in the file and
|
232
|
-
takes the form of:
|
233
|
-
|
234
|
-
<pre>
|
235
|
-
---
|
236
|
-
layout: post
|
237
|
-
title: Blogging Like a Hacker
|
238
|
-
---
|
239
|
-
</pre>
|
240
|
-
|
241
|
-
Between the triple-dashed lines, you can set predefined variables (see below
|
242
|
-
for a reference) or custom data of your own.
|
243
|
-
|
244
|
-
h3. Predefined Global Variables
|
245
|
-
|
246
|
-
layout
|
247
|
-
If set, this specifies the layout file to use. Use the layout file
|
248
|
-
name without file extension. Layout files must be placed in the
|
249
|
-
<code>_layouts</code> directory.
|
250
|
-
|
251
|
-
h3. Predefined Post Variables
|
252
|
-
|
253
|
-
permalink
|
254
|
-
If you need your processed URLs to be something other than the default
|
255
|
-
/year/month/day/title.html then you can set this variable and it will
|
256
|
-
be used as the final URL.
|
257
|
-
|
258
|
-
h3. Custom Variables
|
259
|
-
|
260
|
-
Any variables in the front matter that are not predefined are mixed into the
|
261
|
-
data that is sent to the Liquid templating engine during the conversion. For
|
262
|
-
instance, if you set a <code>title</code>, you can use that in your layout to
|
263
|
-
set the page title:
|
264
|
-
|
265
|
-
<pre>
|
266
|
-
<title>{{ page.title }}</title>
|
267
|
-
</pre>
|
268
|
-
|
269
|
-
h2. Filters, Tags, and Blocks
|
270
|
-
|
271
|
-
In addition to the built-in Liquid filters, tags, and blocks, Jekyll provides
|
272
|
-
some additional items that you can use in your site.
|
273
|
-
|
274
|
-
h3. Date to XML Schema (Filter)
|
275
|
-
|
276
|
-
Convert a Time into XML Schema format.
|
277
|
-
|
278
|
-
{{ site.time | date_to_xmlschema }}
|
279
|
-
|
280
|
-
becomes
|
281
|
-
|
282
|
-
2008-11-17T13:07:54-08:00
|
283
|
-
|
284
|
-
h3. XML Escape (Filter)
|
285
|
-
|
286
|
-
Escape some text for use in XML.
|
287
|
-
|
288
|
-
{{ post.content | xml_escape }}
|
289
|
-
|
290
|
-
h3. Number of Words (Filter)
|
291
|
-
|
292
|
-
Count the number of words in some text.
|
293
|
-
|
294
|
-
{{ post.content | number_of_words }}
|
295
|
-
|
296
|
-
becomes
|
297
|
-
|
298
|
-
1337
|
299
|
-
|
300
|
-
h3. Array to Sentence String
|
301
|
-
|
302
|
-
Convert an array into a sentence.
|
303
|
-
|
304
|
-
{{ page.tags | array_to_sentence_string }}
|
305
|
-
|
306
|
-
becomes
|
307
|
-
|
308
|
-
foo, bar, and baz
|
309
|
-
|
310
|
-
h3. Include (Tag)
|
311
|
-
|
312
|
-
If you have small page fragments that you wish to include in multiple places
|
313
|
-
on your site, you can use the <code>include</code> tag.
|
314
|
-
|
315
|
-
<pre>{% include sig.textile %}</pre>
|
316
|
-
|
317
|
-
Jekyll expects all include files to be placed in an <code>_includes</code>
|
318
|
-
directory at the root of your source dir. So this will embed the contents of
|
319
|
-
<code>/path/to/proto/site/_includes/sig.textile</code> into the calling file.
|
320
|
-
|
321
|
-
h3. Code Highlighting (Block)
|
322
|
-
|
323
|
-
Jekyll has built in support for syntax highlighting of over "100
|
324
|
-
languages":http://pygments.org/languages/ via "Pygments":http://pygments.org/.
|
325
|
-
In order to take advantage of this you'll need to have Pygments installed, and
|
326
|
-
the pygmentize binary must be in your path. When you run Jekyll, make sure you
|
327
|
-
run it with Pygments support:
|
328
|
-
|
329
|
-
$ jekyll --pygments
|
330
|
-
|
331
|
-
To denote a code block that should be highlighted:
|
332
|
-
|
333
|
-
<pre>
|
334
|
-
{% highlight ruby %}
|
335
|
-
def foo
|
336
|
-
puts 'foo'
|
337
|
-
end
|
338
|
-
{% endhighlight %}
|
339
|
-
</pre>
|
340
|
-
|
341
|
-
The argument to <code>highlight</code> is the language identifier. To find the
|
342
|
-
appropriate identifier to use for your favorite language, look for the "short
|
343
|
-
name" on the "Lexers":http://pygments.org/docs/lexers/ page.
|
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
|
-
|
359
|
-
In order for the highlighting to show up, you'll need to include a
|
360
|
-
highlighting stylesheet. For an example stylesheet you can look at
|
361
|
-
"syntax.css":http://github.com/mojombo/tpw/tree/master/css/syntax.css. These
|
362
|
-
are the same styles as used by GitHub and you are free to use them for your
|
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.
|
366
|
-
|
367
|
-
h2. Categories
|
368
|
-
|
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:
|
372
|
-
|
373
|
-
<pre>
|
374
|
-
{% for post in site.categories.foo %}
|
375
|
-
<li><span>{{ post.date | date_to_string }}</span> - {{ post.title }}</li>
|
376
|
-
{% endfor %}
|
377
|
-
</pre>
|
378
|
-
|
379
|
-
This would list all the posts in the category 'foo' by date and title.
|
380
|
-
|
381
|
-
The posts within each category are sorted in reverse chronological order.
|
382
|
-
|
383
|
-
h2. Blog migrations
|
384
|
-
|
385
|
-
h3. Movable Type
|
386
|
-
|
387
|
-
To migrate your MT blog into Jekyll, you'll need read access to the database.
|
388
|
-
The lib/jekyll/converters/mt.rb module provides a simple convert to create
|
389
|
-
.markdown files in a _posts directory based on the entries contained therein.
|
390
|
-
|
391
|
-
$ export DB=my_mtdb
|
392
|
-
$ export USER=dbuser
|
393
|
-
$ export PASS=dbpass
|
394
|
-
$ ruby -r './lib/jekyll/converters/mt' -e 'Jekyll::MT.process( \
|
395
|
-
"#{ENV["DB"]}", "#{ENV["USER"]}", "#{ENV["PASS"]}")'
|
396
|
-
|
397
|
-
You may need to adjust the SQL query used to retrieve MT entries. Left alone,
|
398
|
-
it will attempt to pull all entries across all blogs regardless of status.
|
399
|
-
Please check the results and verify the posts before publishing.
|
400
|
-
|
401
|
-
h3. Typo 4+
|
402
|
-
|
403
|
-
To migrate your Typo blog into Jekyll, you'll need read access to the MySQL
|
404
|
-
database. The lib/jekyll/converters/typo.rb module provides a simple convert
|
405
|
-
to create .html, .textile, or .markdown files in a _posts directory based on
|
406
|
-
the entries contained therein.
|
407
|
-
|
408
|
-
$ export DB=my_typo_db
|
409
|
-
$ export USER=dbuser
|
410
|
-
$ export PASS=dbpass
|
411
|
-
$ ruby -r './lib/jekyll/converters/typo' -e 'Jekyll::Typo.process( \
|
412
|
-
"#{ENV["DB"]}", "#{ENV["USER"]}", "#{ENV["PASS"]}")'
|
413
|
-
|
414
|
-
You may need to adjust the code used to filter Typo entries. Left alone,
|
415
|
-
it will attempt to pull all entries across all blogs that were published.
|
416
|
-
This code also has only been tested with Typo version 4+. Previous versions
|
417
|
-
of Typo may not convert correctly. Please check the results and verify the
|
418
|
-
posts before publishing.
|
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
|
24
|
+
* RedCloth 4.1.0: Textile support. This version obeys <notextile> tags. The latest version will still work, but tests will fail.
|
25
|
+
* Liquid: Templating system
|
26
|
+
* Classifier: Generating related posts
|
27
|
+
* Maruku: Default markdown engine
|
28
|
+
* Directory Watcher: Auto-regeneration of sites
|
29
|
+
* Open4: Talking to pygments for syntax highlighting
|
451
30
|
|
452
31
|
h2. License
|
453
32
|
|
@@ -455,21 +34,8 @@ h2. License
|
|
455
34
|
|
456
35
|
Copyright (c) 2008 Tom Preston-Werner
|
457
36
|
|
458
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
459
|
-
a copy of this software and associated documentation files (the
|
460
|
-
'Software'), to deal in the Software without restriction, including
|
461
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
462
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
463
|
-
permit persons to whom the Software is furnished to do so, subject to
|
464
|
-
the following conditions:
|
37
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
465
38
|
|
466
|
-
The above copyright notice and this permission notice shall be
|
467
|
-
included in all copies or substantial portions of the Software.
|
39
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
468
40
|
|
469
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
470
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
471
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
472
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
473
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
474
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
475
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
41
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|