gabrielg-jekyll 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,72 @@
1
+ ==
2
+ * Major Enhancements
3
+ * Added --server option to start a simple WEBrick server on destination directory [github.com/johnreilly and github.com/mchung]
4
+ * Minor Enhancements
5
+ * Added post categories based on directories containing _posts [github.com/mreid]
6
+ * Added new date filter that shows the full month name [github.com/mreid]
7
+ * Make post's YAML front matter available as post.data [github.com/remi]
8
+ * Merge Post's YAML front matter into its to_liquid payload [github.com/remi]
9
+ * Restrict includes to regular files underneath _includes
10
+ * Bug Fixes
11
+ * Change YAML delimiter matcher so as to not chew up 2nd level markdown headers [github.com/mreid]
12
+ * Fix bug that meant page data (such as the date) was not available in templates [github.com/mreid]
13
+ * Properly reject directories in _layouts
14
+
15
+ == 0.2.1 / 2008-12-15
16
+ * Major Changes
17
+ * Use Maruku (pure Ruby) for Markdown by default [github.com/mreid]
18
+ * Allow use of RDiscount with --rdiscount flag
19
+ * Minor Enhancements
20
+ * Don't load directory_watcher unless it's needed [github.com/pjhyett]
21
+
22
+ == 0.2.0 / 2008-12-14
23
+ * Major Changes
24
+ * related_posts is now found in site.related_posts
25
+
26
+ == 0.1.6 / 2008-12-13
27
+ * Major Features
28
+ * Include files in _includes with {% include x.textile %}
29
+
30
+ == 0.1.5 / 2008-12-12
31
+ * Major Features
32
+ * Code highlighting with Pygments if --pygments is specified
33
+ * Disable true LSI by default, enable with --lsi
34
+ * Minor Enhancements
35
+ * Output informative message if RDiscount is not available [github.com/JackDanger]
36
+ * Bug Fixes
37
+ * Prevent Jekyll from picking up the output directory as a source [github.com/JackDanger]
38
+ * Skip related_posts when there is only one post [github.com/JackDanger]
39
+
40
+ == 0.1.4 / 2008-12-08
41
+ * Bug Fixes
42
+ * DATA does not work properly with rubygems
43
+
44
+ == 0.1.3 / 2008-12-06
45
+ * Major Features
46
+ * Markdown support [github.com/vanpelt]
47
+ * Mephisto and CSV converters [github.com/vanpelt]
48
+ * Code hilighting [github.com/vanpelt]
49
+ * Autobuild
50
+ * Bug Fixes
51
+ * Accept both \r\n and \n in YAML header [github.com/vanpelt]
52
+
53
+ == 0.1.2 / 2008-11-22
54
+ * Major Features
55
+ * Add a real "related posts" implementation using Classifier
56
+ * Command Line Changes
57
+ * Allow cli to be called with 0, 1, or 2 args intuiting dir paths
58
+ if they are omitted
59
+
60
+ == 0.1.1 / 2008-11-22
61
+ * Minor Additions
62
+ * Posts now support introspectional data e.g. {{ page.url }}
63
+
64
+ == 0.1.0 / 2008-11-05
65
+ * First release
66
+ * Converts posts written in Textile
67
+ * Converts regular site pages
68
+ * Simple copy of binary files
69
+
70
+ == 0.0.0 / 2008-10-19
71
+ * Birthday!
72
+
@@ -0,0 +1,32 @@
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/convertible.rb
12
+ lib/jekyll/filters.rb
13
+ lib/jekyll/layout.rb
14
+ lib/jekyll/page.rb
15
+ lib/jekyll/post.rb
16
+ lib/jekyll/site.rb
17
+ lib/jekyll/tags/highlight.rb
18
+ lib/jekyll/tags/include.rb
19
+ test/helper.rb
20
+ test/source/_includes/sig.markdown
21
+ test/source/_layouts/default.html
22
+ test/source/_layouts/simple.html
23
+ test/source/_posts/2008-10-18-foo-bar.textile
24
+ test/source/_posts/2008-11-21-complex.textile
25
+ test/source/_posts/2008-12-13-include.markdown
26
+ test/source/css/screen.css
27
+ test/source/index.html
28
+ test/source/posts/2008-12-03-permalinked-post.textile
29
+ test/suite.rb
30
+ test/test_jekyll.rb
31
+ test/test_post.rb
32
+ test/test_site.rb
@@ -0,0 +1,378 @@
1
+ h1. Jekyll
2
+
3
+ Jekyll is a simple, blog aware, static site generator. It takes a template
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.
9
+
10
+ To understand how this all works, open up my
11
+ "TPW":http://github.com/mojombo/tpw repo in a new browser window. I'll be
12
+ referencing the code there.
13
+
14
+ Take a look at
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.
25
+
26
+ You'll also notice Liquid templating code in these files.
27
+ "Liquid":http://www.liquidmarkup.org/ is a simple, extensible templating
28
+ language that makes it easy to embed data in your templates. For my homepage I
29
+ wanted to have a list of all my blog posts. Jekyll hands me a Hash containing
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>.
33
+
34
+ Jekyll gets the list of blog posts by parsing the files in any
35
+ "_posts":http://github.com/mojombo/tpw/tree/master/_posts directory found in
36
+ subdirectories below the root.
37
+ Each post's filename contains 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.
50
+
51
+ Posts are handled in a special way by Jekyll. The date you specify in the
52
+ filename is used to construct the URL in the generated site. The example post,
53
+ for instance, ends up at
54
+ <code>http://tom.preston-werner.com/2008/11/17/blogging-like-a-hacker.html</code>.
55
+
56
+ Categories for posts are derived from the directory structure the posts were
57
+ found within.
58
+ A post that appears in the directory foo/bar/_posts is placed in the categories
59
+ 'foo' and 'bar'.
60
+ By selecting posts from particular categories in your Liquid templates, you will
61
+ be able to host multiple blogs within a site.
62
+
63
+ Files that do not reside in directories prefixed with an underscore are
64
+ mirrored into a corresponding directory structure in the generated site. If a
65
+ file does not have a YAML preface, it is not run through the Liquid
66
+ interpreter. Binary files are copied over unmodified.
67
+
68
+ Jekyll is still a very young project. I've only developed the exact
69
+ functionality that I've needed. As time goes on I'd like to see the project
70
+ mature and support additional features. If you end up using Jekyll for your
71
+ own blog, drop me a line and let me know what you'd like to see in future
72
+ versions. Better yet, fork the project over at GitHub and hack in the features
73
+ yourself!
74
+
75
+ h2. Example Proto-Site
76
+
77
+ My own personal site/blog is generated with Jekyll.
78
+
79
+ The proto-site repo
80
+ ("http://github.com/mojombo/tpw":http://github.com/mojombo/tpw) is converted
81
+ into the actual site
82
+ ("http://tom.preston-werner.com/":http://tom.preston-werner.com)
83
+
84
+ h2. Install
85
+
86
+ The best way to install Jekyll is via RubyGems:
87
+
88
+ $ sudo gem install mojombo-jekyll -s http://gems.github.com/
89
+
90
+ Jekyll requires the gems `directory_watcher`, `liquid`, `open4`,
91
+ and `maruku` (for markdown support). These are automatically
92
+ installed by the gem install command.
93
+
94
+ Maruku comes with optional support for LaTeX to PNG rendering via
95
+ "blahtex":http://gva.noekeon.org/blahtexml/ (Version 0.6) which must be in
96
+ your $PATH along with `dvips`.
97
+
98
+ (NOTE: the version of maruku I am using is `remi-maruku` on GitHub as it
99
+ does not assume a fixed location for `dvips`.)
100
+
101
+ h2. Run
102
+
103
+ $ cd /path/to/proto/site
104
+ $ jekyll
105
+
106
+ This will generate the site and place it in /path/to/proto/site/_site. If
107
+ you'd like the generated site placed somewhere else:
108
+
109
+ $ jekyll /path/to/place/generated/site
110
+
111
+ And if you don't want to be in the proto site root to run Jekyll:
112
+
113
+ $ jekyll /path/to/proto/site /path/to/place/generated/site
114
+
115
+ h2. Run Options
116
+
117
+ There is an autobuild feature that will regenerate your site if any of the
118
+ files change. The autobuild feature can be used on any of the invocations:
119
+
120
+ $ jekyll --auto
121
+
122
+ By default, the "related posts" functionality will produce crappy results.
123
+ In order to get high quality results with a true LSI algorithm, you must
124
+ enable it (it may take some time to run if you have many posts):
125
+
126
+ $ jekyll --lsi
127
+
128
+ For static code highlighting, you can install Pygments (see below) and then
129
+ use that to make your code blocks look pretty. To activate Pygments support
130
+ during the conversion:
131
+
132
+ $ jekyll --pygments
133
+
134
+ By default, Jekyll uses "Maruku":http://maruku.rubyforge.org (pure Ruby) for
135
+ Markdown support. If you'd like to use RDiscount (faster, but requires
136
+ compilation), you must install it (gem install rdiscount) and then you can
137
+ have it used instead:
138
+
139
+ $ jekyll --rdiscount
140
+
141
+ When previewing complex sites locally, simply opening the site in a web
142
+ browser (using file://) can cause problems with links that are relative to
143
+ the site root (e.g., "/stylesheets/style.css"). To get around this, Jekyll
144
+ can launch a simple WEBrick server (works well in conjunction with --auto).
145
+ Default port is 4000:
146
+
147
+ $ jekyll --server [PORT]
148
+
149
+ h2. Data
150
+
151
+ Jekyll traverses your site looking for files to process. Any files with YAML
152
+ front matter (see below) are subject to processing. For each of these files,
153
+ Jekyll makes a variety of data available to the pages via the Liquid
154
+ templating system. The following is a reference of the available data.
155
+
156
+ h3. Global
157
+
158
+ site
159
+ Sitewide information.
160
+
161
+ page
162
+ For Posts, this is the union of the data in the YAML front matter and the
163
+ computed data (such as URL and date). For regular pages, this is just the
164
+ YAML front matter.
165
+
166
+ content
167
+ In layout files, this contains the content of the subview(s). In Posts or
168
+ pages, this is undefined.
169
+
170
+ h3. Site
171
+
172
+ site.time
173
+ The current Time (when you run the jekyll command).
174
+
175
+ site.posts
176
+ A reverse chronological list of all Posts.
177
+
178
+ site.related_posts
179
+ If the page being processed is a Post, this contains a list of up to ten
180
+ related Posts. By default, these are low quality but fast to compute. For
181
+ high quality but slow to compute results, run the jekyll command with the
182
+ --lsi (latent semantic indexing) option.
183
+
184
+ site.categories.CATEGORY
185
+ The list of all posts in category CATEGORY.
186
+
187
+ h3. Post
188
+
189
+ post.title
190
+ The title of the Post.
191
+
192
+ post.url
193
+ The URL of the Post without the domain.
194
+ e.g. /2008/12/14/my-post.html
195
+
196
+ post.date
197
+ The Date assigned to the Post.
198
+
199
+ post.id
200
+ An identifier unique to the Post (useful in RSS feeds).
201
+ e.g. /2008/12/14/my-post
202
+
203
+ post.content
204
+ The content of the Post.
205
+
206
+ post.categories
207
+ The list of categories to which this post belongs.
208
+
209
+ h2. YAML Front Matter
210
+
211
+ Any files that contain a YAML front matter block will be processed by Jekyll
212
+ as special files. The front matter must be the first thing in the file and
213
+ takes the form of:
214
+
215
+ <pre>
216
+ ---
217
+ layout: post
218
+ title: Blogging Like a Hacker
219
+ ---
220
+ </pre>
221
+
222
+ Between the triple-dashed lines, you can set predefined variables (see below
223
+ for a reference) or custom data of your own.
224
+
225
+ h3. Predefined Global Variables
226
+
227
+ layout
228
+ If set, this specifies the layout file to use. Use the layout file
229
+ name without file extension. Layout files must be placed in the
230
+ <code>_layouts</code> directory.
231
+
232
+ h3. Predefined Post Variables
233
+
234
+ permalink
235
+ If you need your processed URLs to be something other than the default
236
+ /year/month/day/title.html then you can set this variable and it will
237
+ be used as the final URL.
238
+
239
+ h3. Custom Variables
240
+
241
+ Any variables in the front matter that are not predefined are mixed into the
242
+ data that is sent to the Liquid templating engine during the conversion. For
243
+ instance, if you set a <code>title</code>, you can use that in your layout to
244
+ set the page title:
245
+
246
+ <pre>
247
+ <title>{{ page.title }}</title>
248
+ </pre>
249
+
250
+ h2. Filters, Tags, and Blocks
251
+
252
+ In addition to the built-in Liquid filters, tags, and blocks, Jekyll provides
253
+ some additional items that you can use in your site.
254
+
255
+ h3. Date to XML Schema (Filter)
256
+
257
+ Convert a Time into XML Schema format.
258
+
259
+ {{ site.time | date_to_xmlschema }}
260
+
261
+ becomes
262
+
263
+ 2008-11-17T13:07:54-08:00
264
+
265
+ h3. XML Escape (Filter)
266
+
267
+ Escape some text for use in XML.
268
+
269
+ {{ post.content | xml_escape }}
270
+
271
+ h3. Number of Words (Filter)
272
+
273
+ Count the number of words in some text.
274
+
275
+ {{ post.content | number_of_words }}
276
+
277
+ becomes
278
+
279
+ 1337
280
+
281
+ h3. Include (Tag)
282
+
283
+ If you have small page fragments that you wish to include in multiple places on your site, you can use the <code>include</code> tag.
284
+
285
+ <pre>{% include sig.textile %}</pre>
286
+
287
+ Jekyll expects all include files to be placed in an <code>_includes</code>
288
+ directory at the root of your source dir. So this will embed the contents of
289
+ <code>/path/to/proto/site/_includes/sig.textile</code> into the calling file.
290
+
291
+ h3. Code Highlighting (Block)
292
+
293
+ Jekyll has built in support for syntax highlighting of over "100
294
+ languages":http://pygments.org/languages/ via "Pygments":http://pygments.org/.
295
+ In order to take advantage of this you'll need to have Pygments installed, and
296
+ the pygmentize binary must be in your path. When you run Jekyll, make sure you
297
+ run it with Pygments support:
298
+
299
+ $ jekyll --pygments
300
+
301
+ To denote a code block that should be highlighted:
302
+
303
+ <pre>
304
+ {% highlight ruby %}
305
+ def foo
306
+ puts 'foo'
307
+ end
308
+ {% endhighlight %}
309
+ </pre>
310
+
311
+ The argument to <code>highlight</code> is the language identifier. To find the
312
+ appropriate identifier to use for your favorite language, look for the "short
313
+ name" on the "Lexers":http://pygments.org/docs/lexers/ page.
314
+
315
+ In order for the highlighting to show up, you'll need to include a
316
+ highlighting stylesheet. For an example stylesheet you can look at
317
+ "syntax.css":http://github.com/mojombo/tpw/tree/master/css/syntax.css. These
318
+ are the same styles as used by GitHub and you are free to use them for your
319
+ own site.
320
+
321
+ h2. Categories
322
+
323
+ Posts are placed into categories based on the directory structure they are found
324
+ within (see above for an example). The categories can be accessed from within
325
+ a Liquid template as follows:
326
+
327
+ <pre>
328
+ {% for post in site.categories.foo %}
329
+ <li><span>{{ post.date | date_to_string }}</span> - {{ post.title }}</li>
330
+ {% endfor %}
331
+ </pre>
332
+
333
+ This would list all the posts in the category 'foo' by date and title.
334
+
335
+ The posts within each category are sorted in reverse chronological order.
336
+
337
+ h2. Contribute
338
+
339
+ If you'd like to hack on Jekyll, grab the source from GitHub. To get
340
+ all of the dependencies, install the gem first.
341
+
342
+ $ git clone git://github.com/mojombo/jekyll
343
+
344
+ The best way to get your changes merged back into core is as follows:
345
+
346
+ # Fork mojombo/jekyll on GitHub
347
+ # Clone down your fork
348
+ # Create a topic branch to contain your change
349
+ # Hack away
350
+ # Do not change the version number, I will do that on my end
351
+ # If necessary, rebase your commits into logical chunks, without errors
352
+ # Push the branch up to GitHub
353
+ # Send me (mojombo) a pull request for your branch
354
+
355
+ h2. License
356
+
357
+ (The MIT License)
358
+
359
+ Copyright (c) 2008 Tom Preston-Werner
360
+
361
+ Permission is hereby granted, free of charge, to any person obtaining
362
+ a copy of this software and associated documentation files (the
363
+ 'Software'), to deal in the Software without restriction, including
364
+ without limitation the rights to use, copy, modify, merge, publish,
365
+ distribute, sublicense, and/or sell copies of the Software, and to
366
+ permit persons to whom the Software is furnished to do so, subject to
367
+ the following conditions:
368
+
369
+ The above copyright notice and this permission notice shall be
370
+ included in all copies or substantial portions of the Software.
371
+
372
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
373
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
374
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
375
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
376
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
377
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
378
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.