jekyll 0.10.0 → 0.11.0

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.

Files changed (64) hide show
  1. data/Gemfile +2 -0
  2. data/History.txt +20 -1
  3. data/README.textile +1 -1
  4. data/Rakefile +2 -0
  5. data/bin/jekyll +92 -2
  6. data/doc/output/book.html +574 -0
  7. data/doc/output/ch00-preface.asc +41 -0
  8. data/doc/output/ch01-quick-start.asc +153 -0
  9. data/doc/output/ch02-directory-layout.asc +90 -0
  10. data/doc/output/stylesheets/handbookish-quirks.css +0 -0
  11. data/doc/output/stylesheets/handbookish.css +231 -0
  12. data/doc/output/stylesheets/scribe-quirks.css +0 -0
  13. data/doc/output/stylesheets/scribe.css +177 -0
  14. data/features/post_data.feature +2 -2
  15. data/features/site_configuration.feature +7 -0
  16. data/features/support/env.rb +3 -0
  17. data/g.pl +48 -0
  18. data/jekyll.gemspec +35 -16
  19. data/lib/jekyll.rb +11 -4
  20. data/lib/jekyll/converters/markdown.rb +14 -2
  21. data/lib/jekyll/converters/textile.rb +2 -1
  22. data/lib/jekyll/convertible.rb +34 -19
  23. data/lib/jekyll/filters.rb +66 -1
  24. data/lib/jekyll/generators/pagination.rb +33 -7
  25. data/lib/jekyll/layout.rb +18 -10
  26. data/lib/jekyll/migrators/csv.rb +3 -3
  27. data/lib/jekyll/migrators/drupal.rb +12 -6
  28. data/lib/jekyll/migrators/enki.rb +49 -0
  29. data/lib/jekyll/migrators/marley.rb +0 -1
  30. data/lib/jekyll/migrators/mephisto.rb +17 -12
  31. data/lib/jekyll/migrators/mt.rb +26 -17
  32. data/lib/jekyll/migrators/posterous.rb +68 -0
  33. data/lib/jekyll/migrators/textpattern.rb +15 -8
  34. data/lib/jekyll/migrators/tumblr.rb +119 -0
  35. data/lib/jekyll/migrators/typo.rb +8 -6
  36. data/lib/jekyll/migrators/wordpress.rb +23 -16
  37. data/lib/jekyll/migrators/wordpressdotcom.rb +70 -0
  38. data/lib/jekyll/page.rb +56 -35
  39. data/lib/jekyll/plugin.rb +1 -0
  40. data/lib/jekyll/post.rb +25 -14
  41. data/lib/jekyll/site.rb +138 -80
  42. data/lib/jekyll/static_file.rb +12 -15
  43. data/lib/jekyll/tags/highlight.rb +5 -5
  44. data/output/stylesheets/scribe-quirks.css +0 -0
  45. data/output/stylesheets/scribe.css +177 -0
  46. data/test/helper.rb +3 -3
  47. data/test/source/_posts/2011-04-12-md-extension.md +7 -0
  48. data/test/source/_posts/2011-04-12-text-extension.text +0 -0
  49. data/test/suite.rb +3 -1
  50. data/test/test_configuration.rb +1 -1
  51. data/test/test_core_ext.rb +1 -1
  52. data/test/test_filters.rb +10 -1
  53. data/test/test_generated_site.rb +2 -2
  54. data/test/test_kramdown.rb +1 -1
  55. data/test/test_page.rb +1 -1
  56. data/test/test_pager.rb +1 -1
  57. data/test/test_post.rb +49 -2
  58. data/test/test_rdiscount.rb +1 -1
  59. data/test/test_redcarpet.rb +21 -0
  60. data/test/test_site.rb +1 -1
  61. data/test/test_tags.rb +14 -1
  62. metadata +104 -38
  63. data/lib/jekyll/albino.rb +0 -120
  64. data/lib/jekyll/migrators/wordpress.com.rb +0 -38
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source :rubygems
2
+ gemspec
data/History.txt CHANGED
@@ -1,3 +1,22 @@
1
+ == 0.11.0 / 2011-07-10
2
+ * Major Enhancements
3
+ * Add command line importer functionality (#253)
4
+ * Add Redcarpet Markdown support (#318)
5
+ * Make markdown/textile extensions configurable (#312)
6
+ * Add `markdownify` filter
7
+ * Minor Enhancements
8
+ * Switch to Albino gem
9
+ * Bundler support
10
+ * Use English library to avoid hoops (#292)
11
+ * Add Posterous importer (#254)
12
+ * Fixes for Wordpress importer (#274, #252, #271)
13
+ * Better error message for invalid post date (#291)
14
+ * Print formatted fatal exceptions to stdout on build failure
15
+ * Add Tumblr importer (#323)
16
+ * Add Enki importer (#320)
17
+ * Bug Fixes
18
+ * Secure additional path exploits
19
+
1
20
  == 0.10.0 / 2010-12-16
2
21
  * Bug Fixes
3
22
  * Add --no-server option.
@@ -75,7 +94,7 @@
75
94
  * Empty tags causes error in read_posts (#84)
76
95
  * Fix pagination to adhere to read/render/write paradigm
77
96
  * Test Enhancement
78
- * cucumber features no longer use site.ports.first where a better
97
+ * cucumber features no longer use site.posts.first where a better
79
98
  alternative is available
80
99
 
81
100
  == 0.5.6 / 2010-01-08
data/README.textile CHANGED
@@ -27,7 +27,6 @@ h2. Runtime Dependencies
27
27
  * Classifier: Generating related posts (Ruby)
28
28
  * Maruku: Default markdown engine (Ruby)
29
29
  * Directory Watcher: Auto-regeneration of sites (Ruby)
30
- * Open4: Talking to pygments for syntax highlighting (Ruby)
31
30
  * Pygments: Syntax highlighting (Python)
32
31
 
33
32
  h2. Developer Dependencies
@@ -35,6 +34,7 @@ h2. Developer Dependencies
35
34
  * Shoulda: Test framework (Ruby)
36
35
  * RR: Mocking (Ruby)
37
36
  * RedGreen: Nicer test output (Ruby)
37
+ * RDiscount: Discount Markdown Processor (Ruby)
38
38
 
39
39
  h2. License
40
40
 
data/Rakefile CHANGED
@@ -2,6 +2,8 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'date'
4
4
 
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), *%w[lib]))
6
+
5
7
  #############################################################################
6
8
  #
7
9
  # Helper functions
data/bin/jekyll CHANGED
@@ -9,7 +9,8 @@ Basic Command Line Usage:
9
9
  jekyll # . -> ./_site
10
10
  jekyll <path to write generated site> # . -> <path>
11
11
  jekyll <path to source> <path to write generated site> # <path> -> <path>
12
-
12
+ jekyll import <importer name> <options> # imports posts using named import script
13
+
13
14
  Configuration is read from '<source>/_config.yml' but can be overriden
14
15
  using the following options:
15
16
 
@@ -18,11 +19,37 @@ HELP
18
19
  require 'optparse'
19
20
  require 'jekyll'
20
21
 
22
+
21
23
  exec = {}
22
24
  options = {}
23
25
  opts = OptionParser.new do |opts|
24
26
  opts.banner = help
25
27
 
28
+ opts.on("--file [PATH]", "File to import from") do |import_file|
29
+ options['file'] = import_file
30
+ end
31
+
32
+ opts.on("--dbname [TEXT]", "DB to import from") do |import_dbname|
33
+ options['dbname'] = import_dbname
34
+ end
35
+
36
+ opts.on("--user [TEXT]", "Username to use when importing") do |import_user|
37
+ options['user'] = import_user
38
+ end
39
+
40
+ opts.on("--pass [TEXT]", "Password to use when importing") do |import_pass|
41
+ options['pass'] = import_pass
42
+ end
43
+
44
+ opts.on("--host [HOST ADDRESS]", "Host to import from") do |import_host|
45
+ options['host'] = import_host
46
+ end
47
+
48
+ opts.on("--site [SITE NAME]", "Site to import from") do |import_site|
49
+ options['site'] = import_site
50
+ end
51
+
52
+
26
53
  opts.on("--[no-]safe", "Safe mode (default unsafe)") do |safe|
27
54
  options['safe'] = safe
28
55
  end
@@ -55,6 +82,10 @@ opts = OptionParser.new do |opts|
55
82
  opts.on("--rdiscount", "Use rdiscount gem for Markdown") do
56
83
  options['markdown'] = 'rdiscount'
57
84
  end
85
+
86
+ opts.on("--redcarpet", "Use redcarpet gem for Markdown") do
87
+ options['markdown'] = 'redcarpet'
88
+ end
58
89
 
59
90
  opts.on("--kramdown", "Use kramdown gem for Markdown") do
60
91
  options['markdown'] = 'kramdown'
@@ -105,6 +136,61 @@ end
105
136
  # Read command line options into `options` hash
106
137
  opts.parse!
107
138
 
139
+
140
+ # Check for import stuff
141
+ if ARGV.size > 0
142
+ if ARGV[0] == 'import'
143
+ migrator = ARGV[1]
144
+
145
+ if migrator.nil?
146
+ puts "Invalid options. Run `jekyll --help` for assistance."
147
+ exit(1)
148
+ else
149
+ migrator = migrator.downcase
150
+ end
151
+
152
+ cmd_options = []
153
+ ['file', 'dbname', 'user', 'pass', 'host', 'site'].each do |p|
154
+ cmd_options << "\"#{options[p]}\"" unless options[p].nil?
155
+ end
156
+
157
+ # It's import time
158
+ puts "Importing..."
159
+
160
+ # Ideally, this shouldn't be necessary. Maybe parse the actual
161
+ # src files for the migrator name?
162
+ migrators = {
163
+ :posterous => 'Posterous',
164
+ :wordpressdotcom => 'WordpressDotCom',
165
+ :wordpress => 'Wordpress',
166
+ :csv => 'CSV',
167
+ :drupal => 'Drupal',
168
+ :enki => 'Enki',
169
+ :mephisto => 'Mephisto',
170
+ :mt => 'MT',
171
+ :textpattern => 'TextPattern',
172
+ :tumblr => 'Tumblr',
173
+ :typo => 'Typo'
174
+ }
175
+
176
+ app_root = File.join(File.dirname(__FILE__), '..')
177
+
178
+ require "#{app_root}/lib/jekyll/migrators/#{migrator}"
179
+
180
+ if Jekyll.const_defined?(migrators[migrator.to_sym])
181
+ migrator_class = Jekyll.const_get(migrators[migrator.to_sym])
182
+ migrator_class.process(*cmd_options)
183
+ else
184
+ puts "Invalid migrator. Run `jekyll --help` for assistance."
185
+ exit(1)
186
+ end
187
+
188
+ exit(0)
189
+ end
190
+ end
191
+
192
+
193
+
108
194
  # Get source and destintation from command line
109
195
  case ARGV.size
110
196
  when 0
@@ -162,7 +248,11 @@ else
162
248
  puts "Building site: #{source} -> #{destination}"
163
249
  begin
164
250
  site.process
165
- rescue Jekyll::FatalException
251
+ rescue Jekyll::FatalException => e
252
+ puts
253
+ puts "ERROR: YOUR SITE COULD NOT BE BUILT:"
254
+ puts "------------------------------------"
255
+ puts e.message
166
256
  exit(1)
167
257
  end
168
258
  puts "Successfully generated site: #{source} -> #{destination}"
@@ -0,0 +1,574 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
+ <meta name="generator" content="AsciiDoc 8.5.3" />
7
+ <title>Jekyll</title>
8
+ <style type="text/css">
9
+ /* ---------------------------------------------------------------------------
10
+ Bare AsciiDoc styles
11
+ Ryan Tomayko <r@tomayko.com>
12
+ --------------------------------------------------------------------------- */
13
+
14
+ body {
15
+ font-family:verdana,helvetica,arial,sans-serif;
16
+ font-size:81.25%; /* 13px */
17
+ line-height:1.538; /* 20px */
18
+ margin:40px auto 50px auto;
19
+ max-width:53.8461538462em; /* 790px */
20
+ color:#333;
21
+ }
22
+
23
+ em {
24
+ font-style:italic;
25
+ }
26
+
27
+ strong {
28
+ font-weight:bold;
29
+ color:#000;
30
+ }
31
+
32
+ tt {
33
+ font-family:consolas, 'lucida console', 'bitstream vera sans mono',
34
+ 'courier new', monospace;
35
+ color:#000;
36
+ }
37
+
38
+ p, ul, ol, dl {
39
+ margin:10px 0
40
+ }
41
+
42
+ dl {
43
+ margin-left:40px
44
+ }
45
+
46
+ dt {
47
+ font-weight:normal;
48
+ color:#000;
49
+ }
50
+
51
+ h1, h2, h3, h4, h5 {
52
+ font-family:'lucida grande',georgia,verdana,helvetica,arial,sans-serif;
53
+ font-weight:normal;
54
+ color:#000;
55
+ }
56
+
57
+ h1 {
58
+ font-size:40px;
59
+ line-height:1.428;
60
+ margin:20px 0;
61
+ }
62
+
63
+ h2 {
64
+ font-size:30px;
65
+ line-height:1.36363636; /* repeating, of course */
66
+ margin:60px 0 20px 0;
67
+ }
68
+
69
+ h2 + .sectionbody {}
70
+
71
+ h3 {
72
+ font-size:24px;
73
+ line-height:1.1;
74
+ margin:30px 0 10px 0;
75
+ }
76
+
77
+ h4 {
78
+ font-size:18px;
79
+ line-height:1.1;
80
+ margin:20px 0 5px 0;
81
+ }
82
+
83
+ h5 {
84
+ font-size:13px;
85
+ font-style:italic;
86
+ line-height:1.1;
87
+ }
88
+
89
+ #header {
90
+ text-align:center;
91
+ margin-bottom:30px;
92
+ }
93
+
94
+ #header h1 { margin-bottom:0 }
95
+
96
+ .title, .sidebar-title {
97
+ font-weight:normal;
98
+ color:#000;
99
+ margin-bottom:0;
100
+ }
101
+
102
+ .admonitionblock .title {
103
+ font-weight:bold;
104
+ }
105
+
106
+ .admonitionblock {
107
+ margin:30px 0px;
108
+ color:#555;
109
+ }
110
+
111
+ .admonitionblock td.icon {
112
+ width:30px;
113
+ padding-right:20px;
114
+ padding-left:20px;
115
+ text-transform:uppercase;
116
+ font-weight:bold;
117
+ color:#888;
118
+ }
119
+
120
+ .listingblock {
121
+ margin: 13px 0;
122
+ }
123
+
124
+ .listingblock .content {
125
+ border:1px solid silver;
126
+ background:#eee;
127
+ padding:5px;
128
+ }
129
+
130
+ .listingblock .content pre {
131
+ margin:0;
132
+ }
133
+
134
+ .literalblock .content {
135
+ margin-left:40px;
136
+ }
137
+
138
+ .verseblock .content {
139
+ white-space:pre
140
+ }
141
+
142
+ .sidebarblock .sidebar-content {
143
+ border:1px solid silver;
144
+ background:#FFFFEE;
145
+ padding:0 10px;
146
+ color:#222;
147
+ font-size:smaller;
148
+ line-height:1.5;
149
+ }
150
+
151
+ .sidebar-title {
152
+ margin:10px 0;
153
+ font-weight:bold;
154
+ color:#442;
155
+ }
156
+
157
+ .quoteblock-content {
158
+ font-style:italic;
159
+ color:#444;
160
+ margin-left:40px;
161
+ }
162
+
163
+ .quoteblock-content .attribution {
164
+ font-style:normal;
165
+ text-align:right;
166
+ color:#000;
167
+ }
168
+
169
+ .exampleblock-content *:first-child { margin-top:0 }
170
+ .exampleblock-content {
171
+ border-left:2px solid silver;
172
+ padding-left:8px;
173
+ }
174
+
175
+ #footer {
176
+ font-size:11px;
177
+ margin-top:40px;
178
+ border-top:1px solid silver;
179
+ color:#555;
180
+ }
181
+
182
+ #author {
183
+ color:#000;
184
+ text-transform:uppercase
185
+ }
186
+
187
+ </style>
188
+ <script type="text/javascript">
189
+ /*<![CDATA[*/
190
+ window.onload = function(){asciidoc.footnotes(); asciidoc.toc(2);}
191
+ var asciidoc = { // Namespace.
192
+
193
+ /////////////////////////////////////////////////////////////////////
194
+ // Table Of Contents generator
195
+ /////////////////////////////////////////////////////////////////////
196
+
197
+ /* Author: Mihai Bazon, September 2002
198
+ * http://students.infoiasi.ro/~mishoo
199
+ *
200
+ * Table Of Content generator
201
+ * Version: 0.4
202
+ *
203
+ * Feel free to use this script under the terms of the GNU General Public
204
+ * License, as long as you do not remove or alter this notice.
205
+ */
206
+
207
+ /* modified by Troy D. Hanson, September 2006. License: GPL */
208
+ /* modified by Stuart Rackham, 2006, 2009. License: GPL */
209
+
210
+ // toclevels = 1..4.
211
+ toc: function (toclevels) {
212
+
213
+ function getText(el) {
214
+ var text = "";
215
+ for (var i = el.firstChild; i != null; i = i.nextSibling) {
216
+ if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
217
+ text += i.data;
218
+ else if (i.firstChild != null)
219
+ text += getText(i);
220
+ }
221
+ return text;
222
+ }
223
+
224
+ function TocEntry(el, text, toclevel) {
225
+ this.element = el;
226
+ this.text = text;
227
+ this.toclevel = toclevel;
228
+ }
229
+
230
+ function tocEntries(el, toclevels) {
231
+ var result = new Array;
232
+ var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
233
+ // Function that scans the DOM tree for header elements (the DOM2
234
+ // nodeIterator API would be a better technique but not supported by all
235
+ // browsers).
236
+ var iterate = function (el) {
237
+ for (var i = el.firstChild; i != null; i = i.nextSibling) {
238
+ if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
239
+ var mo = re.exec(i.tagName);
240
+ if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
241
+ result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
242
+ }
243
+ iterate(i);
244
+ }
245
+ }
246
+ }
247
+ iterate(el);
248
+ return result;
249
+ }
250
+
251
+ var toc = document.getElementById("toc");
252
+ var entries = tocEntries(document.getElementById("content"), toclevels);
253
+ for (var i = 0; i < entries.length; ++i) {
254
+ var entry = entries[i];
255
+ if (entry.element.id == "")
256
+ entry.element.id = "_toc_" + i;
257
+ var a = document.createElement("a");
258
+ a.href = "#" + entry.element.id;
259
+ a.appendChild(document.createTextNode(entry.text));
260
+ var div = document.createElement("div");
261
+ div.appendChild(a);
262
+ div.className = "toclevel" + entry.toclevel;
263
+ toc.appendChild(div);
264
+ }
265
+ if (entries.length == 0)
266
+ toc.parentNode.removeChild(toc);
267
+ },
268
+
269
+
270
+ /////////////////////////////////////////////////////////////////////
271
+ // Footnotes generator
272
+ /////////////////////////////////////////////////////////////////////
273
+
274
+ /* Based on footnote generation code from:
275
+ * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
276
+ */
277
+
278
+ footnotes: function () {
279
+ var cont = document.getElementById("content");
280
+ var noteholder = document.getElementById("footnotes");
281
+ var spans = cont.getElementsByTagName("span");
282
+ var refs = {};
283
+ var n = 0;
284
+ for (i=0; i<spans.length; i++) {
285
+ if (spans[i].className == "footnote") {
286
+ n++;
287
+ // Use [\s\S] in place of . so multi-line matches work.
288
+ // Because JavaScript has no s (dotall) regex flag.
289
+ note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
290
+ noteholder.innerHTML +=
291
+ "<div class='footnote' id='_footnote_" + n + "'>" +
292
+ "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
293
+ n + "</a>. " + note + "</div>";
294
+ spans[i].innerHTML =
295
+ "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
296
+ "' title='View footnote' class='footnote'>" + n + "</a>]";
297
+ var id =spans[i].getAttribute("id");
298
+ if (id != null) refs["#"+id] = n;
299
+ }
300
+ }
301
+ if (n == 0)
302
+ noteholder.parentNode.removeChild(noteholder);
303
+ else {
304
+ // Process footnoterefs.
305
+ for (i=0; i<spans.length; i++) {
306
+ if (spans[i].className == "footnoteref") {
307
+ var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
308
+ href = href.match(/#.*/)[0]; // Because IE return full URL.
309
+ n = refs[href];
310
+ spans[i].innerHTML =
311
+ "[<a href='#_footnote_" + n +
312
+ "' title='View footnote' class='footnote'>" + n + "</a>]";
313
+ }
314
+ }
315
+ }
316
+ }
317
+
318
+ }
319
+ /*]]>*/
320
+ </script>
321
+ </head>
322
+ <body>
323
+ <div id="header">
324
+ <h1>Jekyll</h1>
325
+ <span id="author">Tom Preston-Werner</span><br />
326
+ <span id="email"><tt>&lt;<a href="mailto:&lt;tom@mojombo.com&gt;">&lt;tom@mojombo.com&gt;</a>&gt;</tt></span><br />
327
+ <div id="toc">
328
+ <div id="toctitle">Table of Contents</div>
329
+ <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
330
+ </div>
331
+ </div>
332
+ <div id="content">
333
+ <h2 id="_preface">1. Preface</h2>
334
+ <div class="sectionbody">
335
+ <div class="paragraph"><p>Jekyll was born out the desire to create a blog engine that would make it
336
+ possible to write posts in my local text editor, version those posts with Git,
337
+ and keep up with my desire to tweak the styles and layout of my site.</p></div>
338
+ <div class="paragraph"><p>In other words, I wanted something that fit into my existing software
339
+ development workflow and toolchain. Jekyll handles not only this case, but a
340
+ wide variety of other situations that call for static site generation based on
341
+ converted content and layout templates.</p></div>
342
+ <div class="paragraph"><p>At its core, Jekyll is a text transformation engine. The concept behind the
343
+ system is this: you give it text written in your favorite markup language, be
344
+ that Markdown, Textile, or just plain HTML, and it churns that through a
345
+ layout or series of layout files. Throughout that process you can tweak how
346
+ you want the site URLs to look, what data gets displayed on the layout and
347
+ much more.</p></div>
348
+ <div class="paragraph"><p>If you&#8217;re looking for a simple, yet powerful solution to your blogging or
349
+ static site needs, Jekyll may be just what you&#8217;ve been looking for.</p></div>
350
+ <h3 id="_what_this_book_covers">1.1. What this book covers</h3><div style="clear:left"></div>
351
+ <div class="paragraph"><p><em>Chapter 1, Quick Start</em> covers installation, introduces the Jekyll command
352
+ line interface, and runs through a quick example demonstrating the site
353
+ generator, post generator and how to convert your Jekyll site into a static
354
+ site.</p></div>
355
+ <div class="paragraph"><p><em>Chapter 2, Directory Layout</em> covers the various files and directories that
356
+ comprise a Jekyll site.</p></div>
357
+ <div class="paragraph"><p><em>Chapter 3, Tags and Filters</em></p></div>
358
+ <div class="paragraph"><p><em>Chapter X, Deploying your Jekyll Site</em></p></div>
359
+ <div class="paragraph"><p><em>Chapter X, Customizing Jekyll with Plugins</em></p></div>
360
+ <div class="paragraph"><p><em>Chapter X, Migrating to Jekyll from your Existing Blog</em></p></div>
361
+ <div class="paragraph"><p><em>Chapter X, Configuration Reference</em></p></div>
362
+ </div>
363
+ <h2 id="_chapter_1_quick_start">2. Chapter 1: Quick Start</h2>
364
+ <div class="sectionbody">
365
+ <div class="paragraph"><p>This chapter is designed to get you up and running with Jekyll as quickly as
366
+ possible.</p></div>
367
+ <h3 id="_installation">2.1. Installation</h3><div style="clear:left"></div>
368
+ <div class="paragraph"><p>The best way to install Jekyll is via RubyGems:</p></div>
369
+ <div class="listingblock">
370
+ <div class="content">
371
+ <pre><tt>gem install jekyll</tt></pre>
372
+ </div></div>
373
+ <div class="paragraph"><p>This is all you need in order to get started with a basic Jekyll site. Some
374
+ options require additional packages to be installed.</p></div>
375
+ <div class="paragraph"><p>If you encounter errors during gem installation, you may need to install the
376
+ header files for compiling extension modules for ruby 1.8:</p></div>
377
+ <div class="listingblock">
378
+ <div class="title">Debian</div>
379
+ <div class="content">
380
+ <pre><tt>sudo apt-get install ruby1.8-dev</tt></pre>
381
+ </div></div>
382
+ <div class="listingblock">
383
+ <div class="title">Red Hat / CentOS / Fedora systems</div>
384
+ <div class="content">
385
+ <pre><tt>sudo yum install ruby-devel</tt></pre>
386
+ </div></div>
387
+ <div class="listingblock">
388
+ <div class="title">NearlyFreeSpeech</div>
389
+ <div class="content">
390
+ <pre><tt>RB_USER_INSTALL=true gem install jekyll</tt></pre>
391
+ </div></div>
392
+ <div class="paragraph"><p>If you encounter errors like <tt>Failed to build gem native extension</tt> on Windows
393
+ you may need to install <a href="http://wiki.github.com/oneclick/rubyinstaller/development-kit">RubyInstaller
394
+ DevKit</a>.</p></div>
395
+ <h4 id="_latex_to_png">2.1.1. LaTeX to PNG</h4>
396
+ <div class="paragraph"><p>Maruku comes with optional support for LaTeX to PNG rendering via blahtex
397
+ (Version 0.6) which must be in your $PATH along with @dvips@.</p></div>
398
+ <div class="paragraph"><p>(NOTE: "remi&#8217;s fork of Maruku":http://github.com/remi/maruku/tree/master does
399
+ not assume a fixed location for @dvips@ if you need that fixed)</p></div>
400
+ <h4 id="_rdiscount">2.1.2. RDiscount</h4>
401
+ <div class="paragraph"><p>If you prefer to use
402
+ <a href="http://github.com/rtomayko/rdiscount/tree/master">RDiscount</a> instead of
403
+ <a href="http://maruku.rubyforge.org/">Maruku</a> for markdown, just make sure it&#8217;s
404
+ installed:</p></div>
405
+ <div class="listingblock">
406
+ <div class="content">
407
+ <pre><tt>sudo gem install rdiscount</tt></pre>
408
+ </div></div>
409
+ <div class="paragraph"><p>And run Jekyll with the following option:</p></div>
410
+ <div class="listingblock">
411
+ <div class="content">
412
+ <pre><tt>jekyll --rdiscount</tt></pre>
413
+ </div></div>
414
+ <div class="paragraph"><p>Or, in your @_config.yml@ file put the following so you don&#8217;t have to specify the flag:</p></div>
415
+ <div class="listingblock">
416
+ <div class="content">
417
+ <pre><tt>markdown: rdiscount</tt></pre>
418
+ </div></div>
419
+ <h4 id="_pygments">2.1.3. Pygments</h4>
420
+ <div class="paragraph"><p>If you want syntax highlighting via the @{% highlight %}@ tag in your posts,
421
+ you&#8217;ll need to install <a href="http://pygments.org/">Pygments</a>.</p></div>
422
+ <div class="listingblock">
423
+ <div class="title">On OSX with Homebrew</div>
424
+ <div class="content">
425
+ <pre><tt>brew install pip &amp;&amp; pip install pygments</tt></pre>
426
+ </div></div>
427
+ <div class="listingblock">
428
+ <div class="title">On OSX with MacPorts</div>
429
+ <div class="content">
430
+ <pre><tt>sudo port install python25 py25-pygments</tt></pre>
431
+ </div></div>
432
+ <div class="listingblock">
433
+ <div class="title">Bare OS X Leopard</div>
434
+ <div class="content">
435
+ <pre><tt>sudo easy_install Pygments</tt></pre>
436
+ </div></div>
437
+ <div class="listingblock">
438
+ <div class="title">Archlinux</div>
439
+ <div class="content">
440
+ <pre><tt>sudo pacman -S python-pygments</tt></pre>
441
+ </div></div>
442
+ <div class="listingblock">
443
+ <div class="title">Archlinux python2 for Pygments</div>
444
+ <div class="content">
445
+ <pre><tt>$ sudo pacman -S python2-pygments</tt></pre>
446
+ </div></div>
447
+ <div class="admonitionblock">
448
+ <table><tr>
449
+ <td class="icon">
450
+ <div class="title">Note</div>
451
+ </td>
452
+ <td class="content">python2 pygments version creates a <tt>pygmentize2</tt> executable, while
453
+ Jekyll tries to find <tt>pygmentize</tt>. Either create a symlink <tt># ln -s
454
+ /usr/bin/pygmentize2 /usr/bin/pygmentize</tt> or use the python3 version.</td>
455
+ </tr></table>
456
+ </div>
457
+ <div class="listingblock">
458
+ <div class="title">Ubuntu and Debian</div>
459
+ <div class="content">
460
+ <pre><tt>sudo apt-get install python-pygments</tt></pre>
461
+ </div></div>
462
+ <div class="listingblock">
463
+ <div class="title">Gentoo</div>
464
+ <div class="content">
465
+ <pre><tt>$ sudo emerge -av dev-python/pygments</tt></pre>
466
+ </div></div>
467
+ <h3 id="_creating_your_first_site">2.2. Creating your First Site</h3><div style="clear:left"></div>
468
+ <div class="paragraph"><p>Jekyll comes with a handy generator that will create a barebones skeleton site
469
+ to help you get up and running in no time. Simply create an empty directory to
470
+ contain your site, navigate to it, and run the generator command:</p></div>
471
+ <div class="listingblock">
472
+ <div class="content">
473
+ <pre><tt>$ mkdir mysite
474
+ $ cd mysite
475
+ $ jekyll gen</tt></pre>
476
+ </div></div>
477
+ <div class="paragraph"><p>Make sure the directory is empty or Jekyll will refuse to run. If everything
478
+ was successful, you&#8217;ll be left with a complete, valid Jekyll site that&#8217;s ready
479
+ to be converted into a static site.</p></div>
480
+ <div class="paragraph"><p>To perform the conversion, make sure you&#8217;re in the root of your Jekyll site
481
+ directory and run:</p></div>
482
+ <div class="listingblock">
483
+ <div class="content">
484
+ <pre><tt>$ jekyll --server</tt></pre>
485
+ </div></div>
486
+ <div class="paragraph"><p>If all goes well, you should get a few lines with information about config
487
+ file detection, source and destination paths, and a success message.</p></div>
488
+ <div class="paragraph"><p>The <tt>--server</tt> command line option fires up a simple web server that will
489
+ serve the static site we just generated so that we can easily preview what it
490
+ will look like once we deploy it to a production environment.</p></div>
491
+ <div class="paragraph"><p>Open up your favorite web browser and navigate to:</p></div>
492
+ <div class="listingblock">
493
+ <div class="content">
494
+ <pre><tt>http://localhost:4000</tt></pre>
495
+ </div></div>
496
+ <div class="paragraph"><p>Congratulations! You have now successfully created and converted your first
497
+ Jekyll site!</p></div>
498
+ </div>
499
+ <h2 id="_chapter_2_directory_layout">3. Chapter 2: Directory Layout</h2>
500
+ <div class="sectionbody">
501
+ <div class="paragraph"><p>If you followed the Quick Start in the last chapter, you have a Jekyll site on
502
+ your local machine. Let&#8217;s take a closer look at it and see what makes it tick.
503
+ The file layout should look something like this:</p></div>
504
+ <div class="listingblock">
505
+ <div class="content">
506
+ <pre><tt>.
507
+ |-- _config.yml
508
+ |-- _layouts
509
+ | |-- default.html
510
+ | `-- post.html
511
+ |-- _posts
512
+ | |-- 2007-10-29-why-every-programmer-should-play-nethack.textile
513
+ | `-- 2009-04-26-barcamp-boston-4-roundup.textile
514
+ |-- _site
515
+ |-- images
516
+ | `-- logo.png
517
+ `-- index.html</tt></pre>
518
+ </div></div>
519
+ <div class="paragraph"><p>Notice that some of the files and directories begin with an underscore. These
520
+ have special meaning to Jekyll. The underscore ensures that they will not
521
+ interfere with the rest of your site&#8217;s normal content. It also means that if
522
+ any of your normal files start with an underscore, they will cause problems,
523
+ so try to avoid this.</p></div>
524
+ <h3 id="_config_yml">3.1. _config.yml</h3><div style="clear:left"></div>
525
+ <div class="paragraph"><p>This file stores configuration data. A majority of these options can be
526
+ specified from the command line executable but it&#8217;s easier to throw them in
527
+ here so you don&#8217;t have to type them out every time. Detailed explanations of
528
+ configuration directives can be found in Chapter X.</p></div>
529
+ <h3 id="_layouts">3.2. _layouts</h3><div style="clear:left"></div>
530
+ <div class="paragraph"><p>Files in this directory represent templates that can be used to wrap converted
531
+ pages. Layouts are defined on a page-by-page basis in the YAML front matter.
532
+ The liquid tag <tt>{{ content }}</tt> specifies where the content will be placed
533
+ during the conversion process.</p></div>
534
+ <h3 id="_posts">3.3. _posts</h3><div style="clear:left"></div>
535
+ <div class="paragraph"><p>If you&#8217;re using Jekyll as a blog engine, this is where you&#8217;ll place your blog
536
+ posts. A post&#8217;s filename contains several pieces of data, so you must be very
537
+ careful about how these files are named. The filename format is:
538
+ <tt>YEAR-MONTH-DATE-SLUG.MARKUP</tt>. The YEAR must be four numbers and the MONTH and
539
+ DATE must be two numbers each. The SLUG is what will appear in the URL. The
540
+ MARKUP tells Jekyll the format of the post. The date and slug will be used
541
+ along with any permalink options you specify (See Chapter X) to construct the
542
+ final URL of the post.</p></div>
543
+ <h3 id="_site">3.4. _site</h3><div style="clear:left"></div>
544
+ <div class="paragraph"><p>This is where the generated site will be placed (by default) once Jekyll is
545
+ done transforming it. If you&#8217;re using version control, you&#8217;ll want to add this
546
+ directory to the list of files to be ignored.</p></div>
547
+ <h3 id="_normal_files_with_yaml_front_matter">3.5. Normal Files with YAML Front Matter</h3><div style="clear:left"></div>
548
+ <div class="paragraph"><p>All files outside of the special underscore directories and that do not
549
+ themselves begin with an underscore will be scanned by Jekyll and subjected to
550
+ conversion if they contain any YAML front matter.</p></div>
551
+ <h3 id="_everything_else">3.6. Everything Else</h3><div style="clear:left"></div>
552
+ <div class="paragraph"><p>Any files and directories that do not fall into one of the above categories
553
+ will be copied to the static site as-is without modification. In this example,
554
+ <tt>images/logo.png</tt> will be copied to the same location in the generated site.</p></div>
555
+ <div class="paragraph"><p>h2. Running Jekyll</p></div>
556
+ <div class="paragraph"><p>Usually this is done through the @jekyll@ executable, which is installed with
557
+ the gem. In order to get a server up and running with your Jekyll site, run:</p></div>
558
+ <div class="paragraph"><p>@jekyll --server@</p></div>
559
+ <div class="paragraph"><p>and then browse to <a href="http://0.0.0.0:4000">http://0.0.0.0:4000</a>. There&#8217;s plenty of <a id="configuration options|Configuration"></a> available to you as well.</p></div>
560
+ <div class="paragraph"><p>On Debian or Ubuntu, you may need to add @/var/lib/gems/1.8/bin/@ to your path.</p></div>
561
+ <div class="paragraph"><p>h2. Deployment</p></div>
562
+ <div class="paragraph"><p>Since Jekyll simply generates a folder filled with HTML files, it can be
563
+ served using practically any available web server out there. Please check the
564
+ <a id="Deployment"></a> page for more information regarding specific scenarios.</p></div>
565
+ </div>
566
+ </div>
567
+ <div id="footnotes"><hr /></div>
568
+ <div id="footer">
569
+ <div id="footer-text">
570
+ Last updated 2011-03-18 21:05:02 PDT
571
+ </div>
572
+ </div>
573
+ </body>
574
+ </html>