<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>features/pagination.feature</filename>
    </added>
    <added>
      <filename>features/permalinks.feature</filename>
    </added>
    <added>
      <filename>lib/jekyll/pager.rb</filename>
    </added>
    <added>
      <filename>test/source/_posts/2009-03-12-hash-#1.markdown</filename>
    </added>
    <added>
      <filename>test/source/_posts/2009-05-18-tag.textile</filename>
    </added>
    <added>
      <filename>test/source/_posts/2009-05-18-tags.textile</filename>
    </added>
    <added>
      <filename>test/source/_posts/2009-06-22-empty-yaml.textile</filename>
    </added>
    <added>
      <filename>test/source/_posts/2009-06-22-no-yaml.textile</filename>
    </added>
    <added>
      <filename>test/source/about.html</filename>
    </added>
    <added>
      <filename>test/source/contacts.html</filename>
    </added>
    <added>
      <filename>test/source/win/_posts/2009-05-24-yaml-linebreak.markdown</filename>
    </added>
    <added>
      <filename>test/test_configuration.rb</filename>
    </added>
    <added>
      <filename>test/test_page.rb</filename>
    </added>
    <added>
      <filename>test/test_pager.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,31 @@
+== 0.5.2 / 2009-06-24
+  * Enhancements
+    * Added --paginate option to the executable along with a paginator object for the payload [github.com/calavera]
+    * Upgraded RedCloth to 4.2.1, which makes &lt;notextile&gt; tags work once again.
+    * Configuration options set in config.yml are now available through the site payload [github.com/vilcans]
+    * Posts can now have an empty YAML front matter or none at all [github.com/bahuvrihi]
+  * Bug Fixes
+    * Fixing Ruby 1.9 issue that requires to_s on the err object [github.com/Chrononaut]
+    * Fixes for pagination and ordering posts on the same day [github.com/ujh]
+    * Made pages respect permalinks style and permalinks in yml front matter [github.com/eugenebolshakov]
+    * Index.html file should always have index.html permalink [github.com/eugenebolshakov]
+    * Added trailing slash to pretty permalink style so Apache is happy [github.com/eugenebolshakov]
+    * Bad markdown processor in config fails sooner and with better message [github.com/gcnovus]
+    * Allow CRLFs in yaml frontmatter [github.com/juretta]
+    * Added Date#xmlschema for Ruby versions &lt; 1.9
+
+== 0.5.1 / 2009-05-06
+  * Major Enhancements
+    * Next/previous posts in site payload [github.com/pantulis, github.com/tomo]
+    * Permalink templating system
+    * Moved most of the README out to the GitHub wiki
+    * Exclude option in configuration so specified files won't be brought over with generated site [github.com/duritong]
+  * Bug Fixes
+    * Making sure config.yaml references are all gone, using only config.yml
+    * Fixed syntax highlighting breaking for UTF-8 code [github.com/henrik]
+    * Worked around RDiscount bug that prevents Markdown from getting parsed after highlight [github.com/henrik]
+    * CGI escaped post titles [github.com/Chrononaut]
+
 == 0.5.0 / 2009-04-07
   * Minor Enhancements
     * Ability to set post categories via YAML [github.com/qrush]</diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -1,64 +1,28 @@
 h1. Jekyll
 
-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. Visit
-&quot;http://tom.preston-werner.com&quot;:http://tom.preston-werner.com to see an
-example of a Jekyll generated blog.
-
-To understand how this all works, open up my
-&quot;TPW&quot;:http://github.com/mojombo/tpw repo in a new browser window. I'll be
-referencing the code there.
-
-Take a look at
-&quot;index.html&quot;:http://github.com/mojombo/tpw/tree/master/index.html. This file
-represents the homepage of the site. At the top of the file is a chunk of YAML
-that contains metadata about the file. This data tells Jekyll what layout to
-give the file, what the page's title should be, etc. In this case, I specify
-that the &quot;default&quot; template should be used. You can find the layout files in
-the &quot;_layouts&quot;:http://github.com/mojombo/tpw/tree/master/_layouts directory.
-If you open
-&quot;default.html&quot;:http://github.com/mojombo/tpw/tree/master/_layouts/default.html
-you can see that the homepage is constructed by wrapping index.html with this
-layout.
-
-You'll also notice Liquid templating code in these files.
-&quot;Liquid&quot;:http://www.liquidmarkup.org/ is a simple, extensible templating
-language that makes it easy to embed data in your templates. For my homepage I
-wanted to have a list of all my blog posts. Jekyll hands me a Hash containing
-various data about my site. A reverse chronological list of all my blog posts
-can be found in &lt;code&gt;site.posts&lt;/code&gt;. Each post, in turn, contains various
-fields such as &lt;code&gt;title&lt;/code&gt; and &lt;code&gt;date&lt;/code&gt;.
-
-Jekyll gets the list of blog posts by parsing the files in any
-&quot;_posts&quot;:http://github.com/mojombo/tpw/tree/master/_posts directory found in
-subdirectories below the root. 
-Each post's filename contains (by default) the publishing date and slug (what shows up in the
-URL) that the final HTML file should have. Open up the file corresponding to a
-blog post:
-&quot;2008-11-17-blogging-like-a-hacker.textile&quot;:http://github.com/mojombo/tpw/tree/master/_posts/2008-11-17-blogging-like-a-hacker.textile.
-GitHub renders textile files by default, so to better understand the file,
-click on the
-&quot;raw&quot;:http://github.com/mojombo/tpw/tree/master/_posts/2008-11-17-blogging-like-a-hacker.textile?raw=true
-view to see the original file. Here I've specified the &lt;code&gt;post&lt;/code&gt;
-layout. If you look at that file you'll see an example of a nested layout.
-Layouts can contain other layouts allowing you a great deal of flexibility in
-how pages are assembled. In my case I use a nested layout in order to show
-related posts for each blog entry. The YAML also specifies the post's title
-which is then embedded in the post's body via Liquid.
-
-Posts are handled in a special way by Jekyll. The date you specify in the
-filename is used to construct the URL in the generated site. The example post,
-for instance, ends up at
-&lt;code&gt;http://tom.preston-werner.com/2008/11/17/blogging-like-a-hacker.html&lt;/code&gt;.
-
-Categories for posts are derived from the directory structure the posts were
-found within. A post that appears in the directory foo/bar/_posts is placed in
-the categories 'foo' and 'bar'. By selecting posts from particular categories
-in your Liquid templates, you will be able to host multiple blogs within a
-site.
+By Tom Preston-Werner, Nick Quaranto, and many awesome contributors!
 
+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 &quot;GitHub Pages&quot;:http://pages.github.com, which you can use to host your project's page or blog right here from GitHub.
+
+h2. Getting Started
+
+* &quot;Install&quot;:http://wiki.github.com/mojombo/jekyll/install the gem
+* Read up about its &quot;Usage&quot;:http://wiki.github.com/mojombo/jekyll/usage and &quot;Configuration&quot;:http://wiki.github.com/mojombo/jekyll/configuration
+* Take a gander at some existing &quot;Sites&quot;:http://wiki.github.com/mojombo/jekyll/sites
+* Fork and &quot;Contribute&quot;:http://wiki.github.com/mojombo/jekyll/contribute your own modifications
+* Have questions? Post them on the &quot;Mailing List&quot;:http://groups.google.com/group/jekyll-rb
+
+h2. Diving In
+
+* &quot;Migrate&quot;:http://wiki.github.com/mojombo/jekyll/blog-migrations from your previous system
+* Learn how the &quot;YAML Front Matter&quot;:http://wiki.github.com/mojombo/jekyll/yaml-front-matter works
+* Put information on your site with &quot;Template Data&quot;:http://wiki.github.com/mojombo/jekyll/template-data
+* Customize the &quot;Permalinks&quot;:http://wiki.github.com/mojombo/jekyll/permalinks your posts are generated with
+* Use the built-in &quot;Liquid Extensions&quot;:http://wiki.github.com/mojombo/jekyll/liquid-extensions to make your life easier
+
+h2. Dependencies
+
+&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD:README.textile
 Files that do not reside in directories prefixed with an underscore are
 mirrored into a corresponding directory structure in the generated site. If a
 file does not have a YAML preface, it is not run through the Liquid
@@ -552,6 +516,14 @@ your changes merged back into core is as follows:
 # If necessary, rebase your commits into logical chunks, without errors
 # Push the branch up to GitHub
 # Send me (mojombo) a pull request for your branch
+=======
+* RedCloth: Textile support
+* Liquid: Templating system
+* Classifier: Generating related posts
+* Maruku: Default markdown engine
+* Directory Watcher: Auto-regeneration of sites
+* Open4: Talking to pygments for syntax highlighting
+&gt;&gt;&gt;&gt;&gt;&gt;&gt; f1c8e388e406e2cc022354562d8bd683d1262072:README.textile
 
 h2. License
 
@@ -559,21 +531,8 @@ h2. License
 
 Copyright (c) 2008 Tom Preston-Werner
 
-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:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-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.
+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:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+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.</diff>
      <filename>README.textile</filename>
    </modified>
    <modified>
      <diff>@@ -15,7 +15,7 @@ begin
     s.rubyforge_project = &quot;jekyll&quot;
     s.files.exclude 'test/dest'
     s.test_files.exclude 'test/dest'
-    s.add_dependency('RedCloth', '&gt;= 4.0.4')
+    s.add_dependency('RedCloth', '&gt;= 4.2.1')
     s.add_dependency('liquid', '&gt;= 1.9.0')
     s.add_dependency('classifier', '&gt;= 1.3.1')
     s.add_dependency('maruku', '&gt;= 0.5.9')
@@ -81,7 +81,7 @@ begin
   require 'cucumber/rake/task'
 
   Cucumber::Rake::Task.new(:features) do |t|
-    t.cucumber_opts = &quot;--format pretty&quot;
+    t.cucumber_opts = &quot;--format progress&quot;
   end
 rescue LoadError
   desc 'Cucumber rake task not available'</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
 --- 
 :major: 0
 :minor: 5
-:patch: 0
+:patch: 2</diff>
      <filename>VERSION.yml</filename>
    </modified>
    <modified>
      <diff>@@ -55,6 +55,16 @@ opts = OptionParser.new do |opts|
   opts.on(&quot;--permalink [TYPE]&quot;, &quot;Use 'date' (default) for YYYY/MM/DD&quot;) do |style|
     options['permalink'] = style unless style.nil?
   end
+  
+  opts.on(&quot;--paginate [POSTS_PER_PAGE]&quot;, &quot;Paginate a blog's posts&quot;) do |per_page|
+    begin
+      options['paginate'] = per_page.to_i
+      raise ArgumentError if options['paginate'] == 0
+    rescue
+      puts 'you must specify a number of posts by page bigger than 0'
+      exit 0
+    end
+  end
 
   opts.on(&quot;--version&quot;, &quot;Display current version&quot;) do
     puts &quot;Jekyll &quot; + Jekyll.version</diff>
      <filename>bin/jekyll</filename>
    </modified>
    <modified>
      <diff>@@ -70,6 +70,17 @@ Feature: Post data
     Then the _site directory should exist
     And I should see &quot;Post category: movies&quot; in &quot;_site/movies/2009/03/27/star-wars.html&quot;
 
+  Scenario: Use post.tags variable
+    Given I have a _posts directory
+    And I have a _layouts directory
+    And I have the following post:
+      | title     | date      | layout | tag   | content                 |
+      | Star Wars | 5/18/2009 | simple | twist | Luke, I am your father. |
+    And I have a simple layout that contains &quot;Post tags: {{ site.posts.first.tags }}&quot;
+    When I run jekyll
+    Then the _site directory should exist
+    And I should see &quot;Post tags: twist&quot; in &quot;_site/2009/05/18/star-wars.html&quot;
+
   Scenario: Use post.categories variable when categories are in folders
     Given I have a movies directory
     And I have a movies/scifi directory
@@ -105,19 +116,6 @@ Feature: Post data
     Then the _site directory should exist
     And I should see &quot;Post categories: movies and scifi&quot; in &quot;_site/movies/scifi/2009/03/27/star-wars.html&quot;
 
-  Scenario: Use post.topics variable
-    Given I have a _posts directory
-    And I have a _posts/movies directory
-    And I have a _posts/movies/scifi directory
-    And I have a _layouts directory
-    And I have the following post under &quot;movies/scifi&quot;:
-      | title     | date      | layout | content                 |
-      | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
-    And I have a simple layout that contains &quot;Post topics: {{ site.posts.first.topics | array_to_sentence_string }}&quot;
-    When I run jekyll
-    Then the _site directory should exist
-    And I should see &quot;Post topics: movies and scifi&quot; in &quot;_site/2009/03/27/star-wars.html&quot;
-
   Scenario: Disable a post from being published
     Given I have a _posts directory
     And I have an &quot;index.html&quot; file that contains &quot;Published!&quot;</diff>
      <filename>features/post_data.feature</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,29 @@ Feature: Site configuration
     Then the _mysite directory should exist
     And I should see &quot;Changing destination directory&quot; in &quot;_mysite/index.html&quot;
 
+  Scenario: Exclude files inline
+    Given I have an &quot;Rakefile&quot; file that contains &quot;I want to be excluded&quot;
+    And I have an &quot;README&quot; file that contains &quot;I want to be excluded&quot;
+    And I have an &quot;index.html&quot; file that contains &quot;I want to be included&quot;
+    And I have a configuration file with &quot;exclude&quot; set to &quot;Rakefile&quot;, &quot;README&quot;
+    When I run jekyll
+    Then I should see &quot;I want to be included&quot; in &quot;_site/index.html&quot;
+    And the &quot;_site/Rakefile&quot; file should not exist
+    And the &quot;_site/README&quot; file should not exist
+
+  Scenario: Exclude files with YAML array
+    Given I have an &quot;Rakefile&quot; file that contains &quot;I want to be excluded&quot;
+    And I have an &quot;README&quot; file that contains &quot;I want to be excluded&quot;
+    And I have an &quot;index.html&quot; file that contains &quot;I want to be included&quot;
+    And I have a configuration file with &quot;exclude&quot; set to:
+      | Value    |
+      | README   |
+      | Rakefile |
+    When I run jekyll
+    Then I should see &quot;I want to be included&quot; in &quot;_site/index.html&quot;
+    And the &quot;_site/Rakefile&quot; file should not exist
+    And the &quot;_site/README&quot; file should not exist
+
   Scenario: Use RDiscount for markup
     Given I have an &quot;index.markdown&quot; page that contains &quot;[Google](http://google.com)&quot;
     And I have a configuration file with &quot;markdown&quot; set to &quot;rdiscount&quot;
@@ -32,26 +55,6 @@ Feature: Site configuration
     Then the _site directory should exist
     And I should see &quot;&lt;a href='http://google.com'&gt;Google&lt;/a&gt;&quot; in &quot;_site/index.html&quot;
 
-  Scenario: Use none permalink schema
-    Given I have a _posts directory
-    And I have the following post:
-      | title                 | date      | content          |
-      | None Permalink Schema | 3/27/2009 | Totally nothing. |
-    And I have a configuration file with &quot;permalink&quot; set to &quot;none&quot;
-    When I run jekyll
-    Then the _site directory should exist
-    And I should see &quot;Totally nothing.&quot; in &quot;_site/none-permalink-schema.html&quot;
-
-  Scenario: Use pretty permalink schema
-    Given I have a _posts directory
-    And I have the following post:
-      | title                   | date      | content            |
-      | Pretty Permalink Schema | 3/27/2009 | Totally wordpress. |
-    And I have a configuration file with &quot;permalink&quot; set to &quot;pretty&quot;
-    When I run jekyll
-    Then the _site directory should exist
-    And I should see &quot;Totally wordpress.&quot; in &quot;_site/2009/03/27/pretty-permalink-schema/index.html&quot;
-
   Scenario: Highlight code with pygments
     Given I have an &quot;index.html&quot; file that contains &quot;{% highlight ruby %} puts 'Hello world!' {% endhighlight %}&quot;
     And I have a configuration file with &quot;pygments&quot; set to &quot;true&quot;</diff>
      <filename>features/site_configuration.feature</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,7 @@ Feature: Site data
     And I should see &quot;Contact: email@me.com&quot; in &quot;_site/contact.html&quot;
 
   Scenario: Use site.time variable
-    Given I have an &quot;index.html&quot; page that contains &quot;Generated on: {{ site.time }}&quot;
+    Given I have an &quot;index.html&quot; page that contains &quot;{{ site.time }}&quot;
     When I run jekyll
     Then the _site directory should exist
     And I should see today's time in &quot;_site/index.html&quot;
@@ -49,3 +49,34 @@ Feature: Site data
     When I run jekyll
     Then the _site directory should exist
     And I should see &quot;Awesome Hack&quot; in &quot;_site/index.html&quot;
+
+  Scenario: Use site.tags variable
+    Given I have a _posts directory
+    And I have an &quot;index.html&quot; page that contains &quot;{% for post in site.tags.beer %} {{ post.content }} {% endfor %}&quot;
+    And I have the following posts:
+      | title          | date      | tag  | content            |
+      | Delicious Beer | 3/26/2009 | beer | 1) Yuengling       |
+    When I run jekyll
+    Then the _site directory should exist
+    And I should see &quot;Yuengling&quot; in &quot;_site/index.html&quot;
+
+  Scenario: Order Posts by name when on the same date
+  Given I have a _posts directory
+  And I have an &quot;index.html&quot; page that contains &quot;{% for post in site.posts %}{{ post.title }}:{{ post.previous.title}},{{ post.next.title}} {% endfor %}&quot;
+  And I have the following posts:
+    | title | date      | content |
+    | first | 2/26/2009 | first   |
+    | A     | 3/26/2009 | A       |
+    | B     | 3/26/2009 | B       |
+    | C     | 3/26/2009 | C       |
+    | last  | 4/26/2009 | last    |
+  When I run jekyll
+  Then the _site directory should exist
+  And I should see &quot;last:C, C:B,last B:A,C A:first,B first:,A&quot; in &quot;_site/index.html&quot;
+
+  Scenario: Use configuration date in site payload
+    Given I have an &quot;index.html&quot; page that contains &quot;{{ site.url }}&quot;
+    And I have a configuration file with &quot;url&quot; set to &quot;http://mysite.com&quot;
+    When I run jekyll
+    Then the _site directory should exist
+    And I should see &quot;http://mysite.com&quot; in &quot;_site/index.html&quot;</diff>
      <filename>features/site_data.feature</filename>
    </modified>
    <modified>
      <diff>@@ -57,7 +57,7 @@ Given /^I have the following posts?(?: (.*) &quot;(.*)&quot;)?:$/ do |direction, folder, t
     path = File.join(before || '.', '_posts', after || '.', &quot;#{date}-#{title}.#{post['type'] || 'textile'}&quot;)
 
     matter_hash = {}
-    %w(title layout tags category categories published author).each do |key|
+    %w(title layout tag tags category categories published author).each do |key|
       matter_hash[key] = post[key] if post[key]
     end
     matter = matter_hash.map { |k, v| &quot;#{k}: #{v}\n&quot; }.join.chomp
@@ -86,10 +86,25 @@ Given /^I have a configuration file with &quot;(.*)&quot; set to &quot;(.*)&quot;$/ do |key, value|
   end
 end
 
+Given /^I have a configuration file with &quot;([^\&quot;]*)&quot; set to:$/ do |key, table|
+  File.open('_config.yml', 'w') do |f|
+    f.write(&quot;#{key}:\n&quot;)
+    table.hashes.each do |row|
+      f.write(&quot;- #{row[&quot;Value&quot;]}\n&quot;)
+    end
+    f.close
+  end
+end
+
+
 When /^I run jekyll$/ do
   run_jekyll
 end
 
+When /^I debug jekyll$/ do
+  run_jekyll(:debug =&gt; true)
+end
+
 When /^I change &quot;(.*)&quot; to contain &quot;(.*)&quot;$/ do |file, text|
   File.open(file, 'a') do |f|
     f.write(text)
@@ -100,6 +115,10 @@ Then /^the (.*) directory should exist$/ do |dir|
   assert File.directory?(dir)
 end
 
+Then /^the (.*) file should exist$/ do |file|
+  assert File.file?(file)
+end
+
 Then /^I should see &quot;(.*)&quot; in &quot;(.*)&quot;$/ do |text, file|
   assert_match Regexp.new(text), File.open(file).readlines.join
 end
@@ -109,10 +128,9 @@ Then /^the &quot;(.*)&quot; file should not exist$/ do |file|
 end
 
 Then /^I should see today's time in &quot;(.*)&quot;$/ do |file|
-  assert_match Regexp.new(Time.now.to_s), File.open(file).readlines.join
+  assert_match Regexp.new(Regexp.escape(Time.now.to_s)), File.open(file).readlines.join
 end
 
 Then /^I should see today's date in &quot;(.*)&quot;$/ do |file|
   assert_match Regexp.new(Date.today.to_s), File.open(file).readlines.join
 end
-</diff>
      <filename>features/step_definitions/jekyll_steps.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,9 +10,7 @@ TEST_DIR    = File.join('/', 'tmp', 'jekyll')
 JEKYLL_PATH = File.join(ENV['PWD'], 'bin', 'jekyll')
 
 def run_jekyll(opts = {})
-  if opts[:bg]
-    bg = '&amp;'
-  end
-
-  system &quot;#{JEKYLL_PATH} &gt;&gt; /dev/null&quot;
+  command = JEKYLL_PATH
+  command &lt;&lt; &quot; &gt;&gt; /dev/null 2&gt;&amp;1&quot; if opts[:debug].nil?
+  system command
 end</diff>
      <filename>features/support/env.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,11 +2,15 @@
 
 Gem::Specification.new do |s|
   s.name = %q{jekyll}
+&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD:jekyll.gemspec
   s.version = &quot;0.5.1&quot;
+=======
+  s.version = &quot;0.5.2&quot;
+&gt;&gt;&gt;&gt;&gt;&gt;&gt; f1c8e388e406e2cc022354562d8bd683d1262072:jekyll.gemspec
 
   s.required_rubygems_version = Gem::Requirement.new(&quot;&gt;= 0&quot;) if s.respond_to? :required_rubygems_version=
   s.authors = [&quot;Tom Preston-Werner&quot;]
-  s.date = %q{2009-04-07}
+  s.date = %q{2009-06-24}
   s.default_executable = %q{jekyll}
   s.description = %q{Jekyll is a simple, blog aware, static site generator.}
   s.email = %q{tom@mojombo.com}
@@ -15,6 +19,7 @@ Gem::Specification.new do |s|
     &quot;README.textile&quot;
   ]
   s.files = [
+&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD:jekyll.gemspec
     &quot;History.txt&quot;,
     &quot;README.textile&quot;,
     &quot;Rakefile&quot;,
@@ -62,37 +67,110 @@ Gem::Specification.new do |s|
     &quot;test/test_post.rb&quot;,
     &quot;test/test_site.rb&quot;,
     &quot;test/test_tags.rb&quot;
+=======
+    &quot;.gitignore&quot;,
+     &quot;History.txt&quot;,
+     &quot;README.textile&quot;,
+     &quot;Rakefile&quot;,
+     &quot;VERSION.yml&quot;,
+     &quot;bin/jekyll&quot;,
+     &quot;features/create_sites.feature&quot;,
+     &quot;features/embed_filters.feature&quot;,
+     &quot;features/pagination.feature&quot;,
+     &quot;features/permalinks.feature&quot;,
+     &quot;features/post_data.feature&quot;,
+     &quot;features/site_configuration.feature&quot;,
+     &quot;features/site_data.feature&quot;,
+     &quot;features/step_definitions/jekyll_steps.rb&quot;,
+     &quot;features/support/env.rb&quot;,
+     &quot;jekyll.gemspec&quot;,
+     &quot;lib/jekyll.rb&quot;,
+     &quot;lib/jekyll/albino.rb&quot;,
+     &quot;lib/jekyll/converters/csv.rb&quot;,
+     &quot;lib/jekyll/converters/mephisto.rb&quot;,
+     &quot;lib/jekyll/converters/mt.rb&quot;,
+     &quot;lib/jekyll/converters/textpattern.rb&quot;,
+     &quot;lib/jekyll/converters/typo.rb&quot;,
+     &quot;lib/jekyll/converters/wordpress.rb&quot;,
+     &quot;lib/jekyll/convertible.rb&quot;,
+     &quot;lib/jekyll/core_ext.rb&quot;,
+     &quot;lib/jekyll/filters.rb&quot;,
+     &quot;lib/jekyll/layout.rb&quot;,
+     &quot;lib/jekyll/page.rb&quot;,
+     &quot;lib/jekyll/pager.rb&quot;,
+     &quot;lib/jekyll/post.rb&quot;,
+     &quot;lib/jekyll/site.rb&quot;,
+     &quot;lib/jekyll/tags/highlight.rb&quot;,
+     &quot;lib/jekyll/tags/include.rb&quot;,
+     &quot;test/helper.rb&quot;,
+     &quot;test/source/_includes/sig.markdown&quot;,
+     &quot;test/source/_layouts/default.html&quot;,
+     &quot;test/source/_layouts/simple.html&quot;,
+     &quot;test/source/_posts/2008-02-02-not-published.textile&quot;,
+     &quot;test/source/_posts/2008-02-02-published.textile&quot;,
+     &quot;test/source/_posts/2008-10-18-foo-bar.textile&quot;,
+     &quot;test/source/_posts/2008-11-21-complex.textile&quot;,
+     &quot;test/source/_posts/2008-12-03-permalinked-post.textile&quot;,
+     &quot;test/source/_posts/2008-12-13-include.markdown&quot;,
+     &quot;test/source/_posts/2009-01-27-array-categories.textile&quot;,
+     &quot;test/source/_posts/2009-01-27-categories.textile&quot;,
+     &quot;test/source/_posts/2009-01-27-category.textile&quot;,
+     &quot;test/source/_posts/2009-03-12-hash-#1.markdown&quot;,
+     &quot;test/source/_posts/2009-05-18-tag.textile&quot;,
+     &quot;test/source/_posts/2009-05-18-tags.textile&quot;,
+     &quot;test/source/_posts/2009-06-22-empty-yaml.textile&quot;,
+     &quot;test/source/_posts/2009-06-22-no-yaml.textile&quot;,
+     &quot;test/source/about.html&quot;,
+     &quot;test/source/category/_posts/2008-9-23-categories.textile&quot;,
+     &quot;test/source/contacts.html&quot;,
+     &quot;test/source/css/screen.css&quot;,
+     &quot;test/source/foo/_posts/bar/2008-12-12-topical-post.textile&quot;,
+     &quot;test/source/index.html&quot;,
+     &quot;test/source/win/_posts/2009-05-24-yaml-linebreak.markdown&quot;,
+     &quot;test/source/z_category/_posts/2008-9-23-categories.textile&quot;,
+     &quot;test/suite.rb&quot;,
+     &quot;test/test_configuration.rb&quot;,
+     &quot;test/test_filters.rb&quot;,
+     &quot;test/test_generated_site.rb&quot;,
+     &quot;test/test_page.rb&quot;,
+     &quot;test/test_pager.rb&quot;,
+     &quot;test/test_post.rb&quot;,
+     &quot;test/test_site.rb&quot;,
+     &quot;test/test_tags.rb&quot;
+&gt;&gt;&gt;&gt;&gt;&gt;&gt; f1c8e388e406e2cc022354562d8bd683d1262072:jekyll.gemspec
   ]
-  s.has_rdoc = true
   s.homepage = %q{http://github.com/mojombo/jekyll}
   s.rdoc_options = [&quot;--charset=UTF-8&quot;]
   s.require_paths = [&quot;lib&quot;]
   s.rubyforge_project = %q{jekyll}
-  s.rubygems_version = %q{1.3.0}
+  s.rubygems_version = %q{1.3.4}
   s.summary = %q{Jekyll is a simple, blog aware, static site generator.}
   s.test_files = [
     &quot;test/helper.rb&quot;,
-    &quot;test/suite.rb&quot;,
-    &quot;test/test_filters.rb&quot;,
-    &quot;test/test_generated_site.rb&quot;,
-    &quot;test/test_post.rb&quot;,
-    &quot;test/test_site.rb&quot;,
-    &quot;test/test_tags.rb&quot;
+     &quot;test/suite.rb&quot;,
+     &quot;test/test_configuration.rb&quot;,
+     &quot;test/test_filters.rb&quot;,
+     &quot;test/test_generated_site.rb&quot;,
+     &quot;test/test_page.rb&quot;,
+     &quot;test/test_pager.rb&quot;,
+     &quot;test/test_post.rb&quot;,
+     &quot;test/test_site.rb&quot;,
+     &quot;test/test_tags.rb&quot;
   ]
 
   if s.respond_to? :specification_version then
     current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
-    s.specification_version = 2
+    s.specification_version = 3
 
     if Gem::Version.new(Gem::RubyGemsVersion) &gt;= Gem::Version.new('1.2.0') then
-      s.add_runtime_dependency(%q&lt;RedCloth&gt;, [&quot;&gt;= 4.0.4&quot;])
+      s.add_runtime_dependency(%q&lt;RedCloth&gt;, [&quot;&gt;= 4.2.1&quot;])
       s.add_runtime_dependency(%q&lt;liquid&gt;, [&quot;&gt;= 1.9.0&quot;])
       s.add_runtime_dependency(%q&lt;classifier&gt;, [&quot;&gt;= 1.3.1&quot;])
       s.add_runtime_dependency(%q&lt;maruku&gt;, [&quot;&gt;= 0.5.9&quot;])
       s.add_runtime_dependency(%q&lt;directory_watcher&gt;, [&quot;&gt;= 1.1.1&quot;])
       s.add_runtime_dependency(%q&lt;open4&gt;, [&quot;&gt;= 0.9.6&quot;])
     else
-      s.add_dependency(%q&lt;RedCloth&gt;, [&quot;&gt;= 4.0.4&quot;])
+      s.add_dependency(%q&lt;RedCloth&gt;, [&quot;&gt;= 4.2.1&quot;])
       s.add_dependency(%q&lt;liquid&gt;, [&quot;&gt;= 1.9.0&quot;])
       s.add_dependency(%q&lt;classifier&gt;, [&quot;&gt;= 1.3.1&quot;])
       s.add_dependency(%q&lt;maruku&gt;, [&quot;&gt;= 0.5.9&quot;])
@@ -100,7 +178,7 @@ Gem::Specification.new do |s|
       s.add_dependency(%q&lt;open4&gt;, [&quot;&gt;= 0.9.6&quot;])
     end
   else
-    s.add_dependency(%q&lt;RedCloth&gt;, [&quot;&gt;= 4.0.4&quot;])
+    s.add_dependency(%q&lt;RedCloth&gt;, [&quot;&gt;= 4.2.1&quot;])
     s.add_dependency(%q&lt;liquid&gt;, [&quot;&gt;= 1.9.0&quot;])
     s.add_dependency(%q&lt;classifier&gt;, [&quot;&gt;= 1.3.1&quot;])
     s.add_dependency(%q&lt;maruku&gt;, [&quot;&gt;= 0.5.9&quot;])</diff>
      <filename>jekyll.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,7 @@ require 'redcloth'
 
 # internal requires
 require 'jekyll/core_ext'
+require 'jekyll/pager'
 require 'jekyll/site'
 require 'jekyll/convertible'
 require 'jekyll/custom_filters'
@@ -64,14 +65,15 @@ module Jekyll
     source = override['source'] || Jekyll::DEFAULTS['source']
 
     # Get configuration from &lt;source&gt;/_config.yml
-    config = {}
     config_file = File.join(source, '_config.yml')
     begin
       config = YAML.load_file(config_file)
-      puts &quot;Configuration from #{config_file}&quot;
+      raise &quot;Invalid configuration - #{config_file}&quot; if !config.is_a?(Hash)
+      STDOUT.puts &quot;Configuration from #{config_file}&quot;
     rescue =&gt; err
-      puts &quot;WARNING: Could not read configuration. Using defaults (and options).&quot;
-      puts &quot;\t&quot; + err
+      STDERR.puts &quot;WARNING: Could not read configuration. Using defaults (and options).&quot;
+      STDERR.puts &quot;\t&quot; + err.to_s
+      config = {}
     end
 
     # Merge DEFAULTS &lt; _config.yml &lt; override</diff>
      <filename>lib/jekyll.rb</filename>
    </modified>
    <modified>
      <diff>@@ -56,7 +56,7 @@ class Albino
 
   def initialize(target, lexer = :text, format = :html)
     @target  = File.exists?(target) ? File.read(target) : target rescue target
-    @options = { :l =&gt; lexer, :f =&gt; format }
+    @options = { :l =&gt; lexer, :f =&gt; format, :O =&gt; 'encoding=utf-8' }
   end
 
   def execute(command)
@@ -71,7 +71,9 @@ class Albino
   end
 
   def colorize(options = {})
-    execute @@bin + convert_options(options)
+    html = execute(@@bin + convert_options(options))
+    # Work around an RDiscount bug: http://gist.github.com/97682
+    html.to_s.sub(%r{&lt;/pre&gt;&lt;/div&gt;\Z}, &quot;&lt;/pre&gt;\n&lt;/div&gt;&quot;)
   end
   alias_method :to_s, :colorize
 </diff>
      <filename>lib/jekyll/albino.rb</filename>
    </modified>
    <modified>
      <diff>@@ -17,12 +17,14 @@ module Jekyll
     # Returns nothing
     def read_yaml(base, name)
       self.content = File.read(File.join(base, name))
-
-      if self.content =~ /^(---\s*\n.*?)\n---\s*\n/m
-        self.content = self.content[($1.size + 5)..-1]
-
+      
+      if self.content =~ /^(---\s*\n.*?\n?)(---.*?\n)/m
+        self.content = self.content[($1.size + $2.size)..-1]
+      
         self.data = YAML.load($1)
       end
+      
+      self.data ||= {}
     end
 
     # Transform the contents based on the file extension.</diff>
      <filename>lib/jekyll/convertible.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,4 +19,12 @@ class Hash
 
     target
   end
-end
\ No newline at end of file
+end
+
+# Thanks, ActiveSupport!
+class Date
+  # Converts datetime to an appropriate format for use in XML
+  def xmlschema
+    strftime(&quot;%Y-%m-%dT%H:%M:%S%Z&quot;)
+  end if RUBY_VERSION &lt; '1.9'
+end</diff>
      <filename>lib/jekyll/core_ext.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,11 @@ module Jekyll
     end
 
     def xml_escape(input)
-      input.gsub(&quot;&amp;&quot;, &quot;&amp;amp;&quot;).gsub(&quot;&lt;&quot;, &quot;&amp;lt;&quot;).gsub(&quot;&gt;&quot;, &quot;&amp;gt;&quot;)
+      CGI.escapeHTML(input)
+    end
+
+    def cgi_escape(input)
+      CGI::escape(input)
     end
 
     def number_of_words(input)</diff>
      <filename>lib/jekyll/filters.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ module Jekyll
     include Convertible
 
     attr_accessor :site
-    attr_accessor :ext
+    attr_accessor :name, :ext, :basename
     attr_accessor :data, :content, :output
 
     # Initialize a new Page.
@@ -17,14 +17,47 @@ module Jekyll
     def initialize(site, base, dir, name)
       @site = site
       @base = base
-      @dir = dir
+      @dir  = dir
       @name = name
 
-      self.data = {}
-
       self.process(name)
       self.read_yaml(File.join(base, dir), name)
-      #self.transform
+    end
+
+    # The generated directory into which the page will be placed
+    # upon generation. This is derived from the permalink or, if
+    # permalink is absent, set to '/'
+    #
+    # Returns &lt;String&gt;
+    def dir
+      url[-1, 1] == '/' ? url : File.dirname(url)
+    end
+
+    # The full path and filename of the post.
+    # Defined in the YAML of the post body
+    # (Optional)
+    #
+    # Returns &lt;String&gt;
+    def permalink
+      self.data &amp;&amp; self.data['permalink']
+    end
+
+    def template
+      if self.site.permalink_style == :pretty &amp;&amp; !index?
+        &quot;/:name/&quot;
+      else
+        &quot;/:name.html&quot;
+      end
+    end
+
+    # The generated relative url of this page
+    # e.g. /about.html
+    #
+    # Returns &lt;String&gt;
+    def url
+      return permalink if permalink
+
+      @url ||= template.gsub(':name', basename)
     end
 
     # Extract information from the page filename
@@ -33,6 +66,7 @@ module Jekyll
     # Returns nothing
     def process(name)
       self.ext = File.extname(name)
+      self.basename = name.split('.')[0..-2].first
     end
 
     # Add any necessary layouts to this post
@@ -46,22 +80,33 @@ module Jekyll
     end
 
     # Write the generated page file to the destination directory.
-    #   +dest+ is the String path to the destination dir
+    #   +dest_prefix+ is the String path to the destination dir
+    #   +dest_suffix+ is a suffix path to the destination dir
     #
     # Returns nothing
-    def write(dest)
-      FileUtils.mkdir_p(File.join(dest, @dir))
+    def write(dest_prefix, dest_suffix = nil)
+      dest = File.join(dest_prefix, @dir)
+      dest = File.join(dest, dest_suffix) if dest_suffix
+      FileUtils.mkdir_p(dest)
 
-      name = @name
-      if self.ext != &quot;&quot;
-        name = @name.split(&quot;.&quot;)[0..-2].join('.') + self.ext
+      # The url needs to be unescaped in order to preserve the correct filename
+      path = File.join(dest, CGI.unescape(self.url))
+      if self.url[/\.html$/].nil?
+        FileUtils.mkdir_p(path)
+        path = File.join(path, &quot;index.html&quot;)
       end
 
-      path = File.join(dest, @dir, name)
       File.open(path, 'w') do |f|
         f.write(self.output)
       end
     end
+
+    private
+
+      def index?
+        basename == 'index'
+      end
+
   end
 
-end
\ No newline at end of file
+end</diff>
      <filename>lib/jekyll/page.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,9 +18,12 @@ module Jekyll
       name =~ MATCHER
     end
 
-    attr_accessor :site
-    attr_accessor :date, :slug, :ext, :categories, :topics, :published
-    attr_accessor :data, :content, :output
+    attr_accessor :site, :date, :slug, :ext, :published, :data, :content, :output, :tags
+    attr_writer :categories
+
+    def categories
+      @categories ||= []
+    end
 
     # Initialize this Post instance.
     #   +site+ is the Site
@@ -35,10 +38,6 @@ module Jekyll
       @name = name
 
       self.categories = dir.split('/').reject { |x| x.empty? }
-
-      parts = name.split('/')
-      self.topics = parts.size &gt; 1 ? parts[0..-2] : []
-
       self.process(name)
       self.read_yaml(@base, name)
 
@@ -48,6 +47,14 @@ module Jekyll
         self.published = true
       end
 
+      if self.data.has_key?(&quot;tag&quot;)
+        self.tags = [self.data[&quot;tag&quot;]]
+      elsif self.data.has_key?(&quot;tags&quot;)
+        self.tags = self.data['tags']
+      else
+        self.tags = []
+      end
+
       if self.categories.empty?
         if self.data.has_key?('category')
           self.categories &lt;&lt; self.data['category']
@@ -63,11 +70,15 @@ module Jekyll
       end
     end
 
-    # Spaceship is based on Post#date
+    # Spaceship is based on Post#date, slug
     #
     # Returns -1, 0, 1
     def &lt;=&gt;(other)
-      self.date &lt;=&gt; other.date
+      cmp = self.date &lt;=&gt; other.date
+      if 0 == cmp
+       cmp = self.slug &lt;=&gt; other.slug
+      end
+      return cmp
     end
 
     # Extract information from the post filename
@@ -88,16 +99,7 @@ module Jekyll
     #
     # Returns &lt;String&gt;
     def dir
-      if permalink
-        permalink.to_s.split(&quot;/&quot;)[0..-2].join(&quot;/&quot;) + '/'
-      else
-        prefix = self.categories.empty? ? '' : '/' + self.categories.join('/')
-        if [:date, :pretty].include?(self.site.permalink_style)
-          prefix + date.strftime(&quot;/%Y/%m/%d/&quot;)
-        else
-          prefix + '/'
-        end
-      end
+      File.dirname(url)
     end
 
     # The full path and filename of the post.
@@ -109,13 +111,35 @@ module Jekyll
       self.data &amp;&amp; self.data['permalink']
     end
 
+    def template
+      case self.site.permalink_style
+      when :pretty
+        &quot;/:categories/:year/:month/:day/:title/&quot;
+      when :none
+        &quot;/:categories/:title.html&quot;
+      when :date
+        &quot;/:categories/:year/:month/:day/:title.html&quot;
+      else
+        self.site.permalink_style.to_s
+      end
+    end
+
     # The generated relative url of this post
     # e.g. /2008/11/05/my-awesome-post.html
     #
     # Returns &lt;String&gt;
     def url
-      ext = self.site.permalink_style == :pretty ? '' : '.html'
-      permalink || self.id + ext
+      return permalink if permalink
+
+      @url ||= {
+        &quot;year&quot;       =&gt; date.strftime(&quot;%Y&quot;),
+        &quot;month&quot;      =&gt; date.strftime(&quot;%m&quot;),
+        &quot;day&quot;        =&gt; date.strftime(&quot;%d&quot;),
+        &quot;title&quot;      =&gt; CGI.escape(slug),
+        &quot;categories&quot; =&gt; categories.sort.join('/')
+      }.inject(template) { |result, token|
+        result.gsub(/:#{token.first}/, token.last)
+      }.gsub(/\/\//, &quot;/&quot;)
     end
 
     # The UID for this post (useful in feeds)
@@ -123,7 +147,7 @@ module Jekyll
     #
     # Returns &lt;String&gt;
     def id
-      self.dir + self.slug
+      File.join(self.dir, self.slug)
     end
 
     # Calculate related posts.
@@ -172,9 +196,10 @@ module Jekyll
     def write(dest)
       FileUtils.mkdir_p(File.join(dest, dir))
 
-      path = File.join(dest, self.url)
+      # The url needs to be unescaped in order to preserve the correct filename
+      path = File.join(dest, CGI.unescape(self.url))
 
-      if self.site.permalink_style == :pretty
+      if template[/\.html$/].nil?
         FileUtils.mkdir_p(path)
         path = File.join(path, &quot;index.html&quot;)
       end
@@ -188,15 +213,15 @@ module Jekyll
     #
     # Returns &lt;Hash&gt;
     def to_liquid
-      { &quot;title&quot; =&gt; self.data[&quot;title&quot;] || self.slug.split('-').select {|w| w.capitalize! || w }.join(' '),
-        &quot;url&quot; =&gt; self.url,
-        &quot;date&quot; =&gt; self.date,
-        &quot;id&quot; =&gt; self.id,
-        &quot;topics&quot; =&gt; self.topics,
+      { &quot;title&quot;      =&gt; self.data[&quot;title&quot;] || self.slug.split('-').select {|w| w.capitalize! || w }.join(' '),
+        &quot;url&quot;        =&gt; self.url,
+        &quot;date&quot;       =&gt; self.date,
+        &quot;id&quot;         =&gt; self.id,
         &quot;categories&quot; =&gt; self.categories,
-        &quot;next&quot; =&gt; self.next,
-        &quot;previous&quot; =&gt; self.previous,
-        &quot;content&quot; =&gt; self.content }.deep_merge(self.data)
+        &quot;next&quot;       =&gt; self.next,
+        &quot;previous&quot;   =&gt; self.previous,
+        &quot;tags&quot;       =&gt; self.tags,
+        &quot;content&quot;    =&gt; self.content }.deep_merge(self.data)
     end
 
     def inspect</diff>
      <filename>lib/jekyll/post.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 module Jekyll
 
   class Site
-    attr_accessor :config, :layouts, :posts, :categories
-    attr_accessor :source, :dest, :lsi, :pygments, :permalink_style
+    attr_accessor :config, :layouts, :posts, :categories, :exclude,
+                  :source, :dest, :lsi, :pygments, :permalink_style, :tags
 
     # Initialize the site
     #   +config+ is a Hash containing site configurations details
@@ -16,6 +16,7 @@ module Jekyll
       self.lsi             = config['lsi']
       self.pygments        = config['pygments']
       self.permalink_style = config['permalink'].to_sym
+      self.exclude         = config['exclude'] || []
 
       self.reset
       self.setup
@@ -24,7 +25,8 @@ module Jekyll
     def reset
       self.layouts         = {}
       self.posts           = []
-      self.categories      = Hash.new { |hash, key| hash[key] = Array.new }
+      self.categories      = Hash.new { |hash, key| hash[key] = [] }
+      self.tags            = Hash.new { |hash, key| hash[key] = [] }
     end
 
     def setup
@@ -41,7 +43,6 @@ module Jekyll
               RDiscount.new(content).to_html
             end
 
-            puts 'Using rdiscount for Markdown'
           rescue LoadError
             puts 'You must have the rdiscount gem installed first'
           end
@@ -76,6 +77,8 @@ module Jekyll
           rescue LoadError
             puts &quot;The maruku gem is required for markdown support!&quot;
           end
+        else
+          raise &quot;Invalid Markdown processor: '#{self.config['markdown']}' -- did you mean 'maruku' or 'rdiscount'?&quot;
       end
       
       if self.config['custom_filters']
@@ -140,6 +143,7 @@ module Jekyll
           if post.published
             self.posts &lt;&lt; post
             post.categories.each { |c| self.categories[c] &lt;&lt; post }
+            post.tags.each { |c| self.tags[c] &lt;&lt; post }
           end
         end
       end
@@ -151,7 +155,8 @@ module Jekyll
         post.render(self.layouts, site_payload)
       end
 
-      self.categories.values.map { |cats| cats.sort! { |a, b| b &lt;=&gt; a} }
+      self.categories.values.map { |ps| ps.sort! { |a, b| b &lt;=&gt; a} }
+      self.tags.values.map { |ps| ps.sort! { |a, b| b &lt;=&gt; a} }
     rescue Errno::ENOENT =&gt; e
       # ignore missing layout dir
     end
@@ -186,11 +191,14 @@ module Jekyll
         directories.delete('_posts')
         read_posts(dir)
       end
+      
       [directories, files].each do |entries|
         entries.each do |f|
           if File.directory?(File.join(base, f))
             next if self.dest.sub(/\/$/, '') == File.join(base, f)
             transform_pages(File.join(dir, f))
+          elsif Pager.pagination_enabled?(self.config, f)
+            paginate_posts(f, dir)
           else
             first3 = File.open(File.join(self.source, dir, f)) { |fd| fd.read(3) }
 
@@ -225,15 +233,13 @@ module Jekyll
     #
     # Returns {&quot;site&quot; =&gt; {&quot;time&quot; =&gt; &lt;Time&gt;,
     #                     &quot;posts&quot; =&gt; [&lt;Post&gt;],
-    #                     &quot;categories&quot; =&gt; [&lt;Post&gt;],
-    #                     &quot;topics&quot; =&gt; [&lt;Post&gt;] }}
+    #                     &quot;categories&quot; =&gt; [&lt;Post&gt;]}
     def site_payload
-      {&quot;site&quot; =&gt; {
-        &quot;time&quot; =&gt; Time.now,
-        &quot;posts&quot; =&gt; self.posts.sort { |a,b| b &lt;=&gt; a },
-        &quot;categories&quot; =&gt; post_attr_hash('categories'),
-        &quot;topics&quot; =&gt; post_attr_hash('topics')
-      }}
+      {&quot;site&quot; =&gt; self.config.merge({
+          &quot;time&quot;       =&gt; Time.now,
+          &quot;posts&quot;      =&gt; self.posts.sort { |a,b| b &lt;=&gt; a },
+          &quot;categories&quot; =&gt; post_attr_hash('categories'),
+          &quot;tags&quot;       =&gt; post_attr_hash('tags')})}
     end
 
     # Filter out any files/directories that are hidden or backup files (start
@@ -243,11 +249,32 @@ module Jekyll
     def filter_entries(entries)
       entries = entries.reject do |e|
         unless ['_posts', '.htaccess'].include?(e)
-          # Reject backup/hidden
-          ['.', '_', '#'].include?(e[0..0]) or e[-1..-1] == '~'
+          ['.', '_', '#'].include?(e[0..0]) || e[-1..-1] == '~' || self.exclude.include?(e)
         end
       end
     end
 
+    # Paginates the blog's posts. Renders the index.html file into paginated directories, ie: page2, page3...
+    # and adds more wite-wide data
+    #
+    # {&quot;paginator&quot; =&gt; { &quot;page&quot; =&gt; &lt;Number&gt;,
+    #                   &quot;per_page&quot; =&gt; &lt;Number&gt;,
+    #                   &quot;posts&quot; =&gt; [&lt;Post&gt;],
+    #                   &quot;total_posts&quot; =&gt; &lt;Number&gt;,
+    #                   &quot;total_pages&quot; =&gt; &lt;Number&gt;,
+    #                   &quot;previous_page&quot; =&gt; &lt;Number&gt;,
+    #                   &quot;next_page&quot; =&gt; &lt;Number&gt; }}
+    def paginate_posts(file, dir)
+      all_posts = self.posts.sort { |a,b| b &lt;=&gt; a }
+      pages = Pager.calculate_pages(all_posts, self.config['paginate'].to_i)
+      pages += 1
+      (1..pages).each do |num_page|
+        pager = Pager.new(self.config, num_page, all_posts, pages)
+        page = Page.new(self, self.source, dir, file)
+        page.render(self.layouts, site_payload.merge({'paginator' =&gt; pager.to_hash}))
+        suffix = &quot;page#{num_page}&quot; if num_page &gt; 1
+        page.write(self.dest, suffix)
+      end
+    end
   end
 end</diff>
      <filename>lib/jekyll/site.rb</filename>
    </modified>
    <modified>
      <diff>@@ -30,9 +30,9 @@ module Jekyll
     end
 
     def render_pygments(context, code)
-      if context[&quot;content_type&quot;] == :markdown
+      if context[&quot;content_type&quot;] == &quot;markdown&quot;
         return &quot;\n&quot; + Albino.new(code, @lang).to_s(@options) + &quot;\n&quot;
-      elsif context[&quot;content_type&quot;] == :textile
+      elsif context[&quot;content_type&quot;] == &quot;textile&quot;
         return &quot;&lt;notextile&gt;&quot; + Albino.new(code, @lang).to_s(@options) + &quot;&lt;/notextile&gt;&quot;
       else
         return Albino.new(code, @lang).to_s(@options)</diff>
      <filename>lib/jekyll/tags/highlight.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,6 @@
+require 'rubygems'
+gem 'RedCloth', '= 4.2.1'
+
 require File.join(File.dirname(__FILE__), *%w[.. lib jekyll])
 
 require 'test/unit'</diff>
      <filename>test/helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -37,5 +37,13 @@ class TestFilters &lt; Test::Unit::TestCase
       assert_equal &quot;AT&amp;amp;T&quot;, @filter.xml_escape(&quot;AT&amp;T&quot;)
       assert_equal &quot;&amp;lt;code&amp;gt;command &amp;amp;lt;filename&amp;amp;gt;&amp;lt;/code&amp;gt;&quot;, @filter.xml_escape(&quot;&lt;code&gt;command &amp;lt;filename&amp;gt;&lt;/code&gt;&quot;)
     end
+
+    should &quot;escape space as plus&quot; do
+      assert_equal &quot;my+things&quot;, @filter.cgi_escape(&quot;my things&quot;)
+    end
+
+    should &quot;escape special characters&quot; do
+      assert_equal &quot;hey%21&quot;, @filter.cgi_escape(&quot;hey!&quot;)
+    end
   end
 end</diff>
      <filename>test/test_filters.rb</filename>
    </modified>
    <modified>
      <diff>@@ -17,11 +17,8 @@ class TestGeneratedSite &lt; Test::Unit::TestCase
       assert @index.include?(&quot;#{@site.posts.size} Posts&quot;)
     end
 
-    should &quot;render post.content&quot; do
-      latest_post = Dir[source_dir('_posts', '*')].sort.last
-      post = Post.new(@site, source_dir, '', File.basename(latest_post))
-      post.transform
-      assert @index.include?(post.content)
+    should &quot;render latest post's content&quot; do
+      assert @index.include?(@site.posts.last.content)
     end
 
     should &quot;hide unpublished posts&quot; do
@@ -34,5 +31,10 @@ class TestGeneratedSite &lt; Test::Unit::TestCase
     should &quot;not copy _posts directory&quot; do
       assert !File.exist?(dest_dir('_posts'))
     end
+
+    should &quot;process other static files and generate correct permalinks&quot; do
+      assert File.exists?(dest_dir('/about/index.html'))
+      assert File.exists?(dest_dir('/contacts.html'))
+    end
   end
 end</diff>
      <filename>test/test_generated_site.rb</filename>
    </modified>
    <modified>
      <diff>@@ -41,6 +41,8 @@ class TestPost &lt; Test::Unit::TestCase
         assert_equal Time.parse(&quot;2008-10-19&quot;), @post.date
         assert_equal &quot;foo-bar&quot;, @post.slug
         assert_equal &quot;.textile&quot;, @post.ext
+        assert_equal &quot;/2008/10/19&quot;, @post.dir
+        assert_equal &quot;/2008/10/19/foo-bar&quot;, @post.id
       end
 
       should &quot;create url based on date and title&quot; do
@@ -49,16 +51,114 @@ class TestPost &lt; Test::Unit::TestCase
         assert_equal &quot;/2008/10/19/foo-bar.html&quot;, @post.url
       end
 
-      should &quot;respect permalink&quot; do
+      should &quot;CGI escape urls&quot; do
+        @post.categories = []
+        @post.process(&quot;2009-03-12-hash-#1.markdown&quot;)
+        assert_equal &quot;/2009/03/12/hash-%231.html&quot;, @post.url
+        assert_equal &quot;/2009/03/12/hash-#1&quot;, @post.id
+      end
+
+      should &quot;respect permalink in yaml front matter&quot; do
         file = &quot;2008-12-03-permalinked-post.textile&quot;
         @post.process(file)
         @post.read_yaml(@source, file)
 
         assert_equal &quot;my_category/permalinked-post&quot;, @post.permalink
-        assert_equal &quot;my_category/&quot;, @post.dir
+        assert_equal &quot;my_category&quot;, @post.dir
         assert_equal &quot;my_category/permalinked-post&quot;, @post.url
       end
 
+      context &quot;with CRLF linebreaks&quot; do
+        setup do
+          @real_file = &quot;2009-05-24-yaml-linebreak.markdown&quot;
+          @source = source_dir('win/_posts')
+        end
+        should &quot;read yaml front-matter&quot; do
+          @post.read_yaml(@source, @real_file)
+
+          assert_equal({&quot;title&quot; =&gt; &quot;Test title&quot;, &quot;layout&quot; =&gt; &quot;post&quot;, &quot;tag&quot; =&gt; &quot;Ruby&quot;}, @post.data)
+          assert_equal &quot;\r\nThis is the content&quot;, @post.content
+        end
+      end
+
+      context &quot;with site wide permalink&quot; do
+        setup do
+          @post.categories = []
+        end
+
+        context &quot;with unspecified (date) style&quot; do
+          setup do
+            @post.process(@fake_file)
+          end
+
+          should &quot;process the url correctly&quot; do
+            assert_equal &quot;/:categories/:year/:month/:day/:title.html&quot;, @post.template
+            assert_equal &quot;/2008/10/19/foo-bar.html&quot;, @post.url
+          end
+        end
+
+        context &quot;with unspecified (date) style and a category&quot; do
+          setup do
+            @post.categories &lt;&lt; &quot;beer&quot;
+            @post.process(@fake_file)
+          end
+
+          should &quot;process the url correctly&quot; do
+            assert_equal &quot;/:categories/:year/:month/:day/:title.html&quot;, @post.template
+            assert_equal &quot;/beer/2008/10/19/foo-bar.html&quot;, @post.url
+          end
+        end
+
+        context &quot;with unspecified (date) style and categories&quot; do
+          setup do
+            @post.categories &lt;&lt; &quot;food&quot;
+            @post.categories &lt;&lt; &quot;beer&quot;
+            @post.process(@fake_file)
+          end
+
+          should &quot;process the url correctly&quot; do
+            assert_equal &quot;/:categories/:year/:month/:day/:title.html&quot;, @post.template
+            assert_equal &quot;/beer/food/2008/10/19/foo-bar.html&quot;, @post.url
+          end
+        end
+
+        context &quot;with none style&quot; do
+          setup do
+            @post.site.permalink_style = :none
+            @post.process(@fake_file)
+          end
+
+          should &quot;process the url correctly&quot; do
+            assert_equal &quot;/:categories/:title.html&quot;, @post.template
+            assert_equal &quot;/foo-bar.html&quot;, @post.url
+          end
+        end
+
+        context &quot;with pretty style&quot; do
+          setup do
+            @post.site.permalink_style = :pretty
+            @post.process(@fake_file)
+          end
+
+          should &quot;process the url correctly&quot; do
+            assert_equal &quot;/:categories/:year/:month/:day/:title/&quot;, @post.template
+            assert_equal &quot;/2008/10/19/foo-bar/&quot;, @post.url
+          end
+        end
+
+        context &quot;with prefix style and no extension&quot; do
+          setup do
+            @post.site.permalink_style = &quot;/prefix/:title&quot;
+            @post.process(@fake_file)
+          end
+
+          should &quot;process the url correctly&quot; do
+            assert_equal &quot;/prefix/:title&quot;, @post.template
+            assert_equal &quot;/prefix/foo-bar&quot;, @post.url
+          end
+        end
+      end
+
       should &quot;read yaml front-matter&quot; do
         @post.read_yaml(@source, @real_file)
 
@@ -124,6 +224,28 @@ class TestPost &lt; Test::Unit::TestCase
         assert post.categories.include?('baz')
       end
 
+      should &quot;recognize tag in yaml&quot; do
+        post = setup_post(&quot;2009-05-18-tag.textile&quot;)
+        assert post.tags.include?('code')
+      end
+
+      should &quot;recognize tags in yaml&quot; do
+        post = setup_post(&quot;2009-05-18-tags.textile&quot;)
+        assert post.tags.include?('food')
+        assert post.tags.include?('cooking')
+        assert post.tags.include?('pizza')
+      end
+      
+      should &quot;allow no yaml&quot; do
+        post = setup_post(&quot;2009-06-22-no-yaml.textile&quot;)
+        assert_equal &quot;No YAML.&quot;, post.content
+      end
+
+      should &quot;allow empty yaml&quot; do
+        post = setup_post(&quot;2009-06-22-empty-yaml.textile&quot;)
+        assert_equal &quot;Empty YAML.&quot;, post.content
+      end
+
       context &quot;rendering&quot; do
         setup do
           clear_dest
@@ -144,6 +266,16 @@ class TestPost &lt; Test::Unit::TestCase
           assert File.exists?(File.join(dest_dir, '2008', '10', '18', 'foo-bar.html'))
         end
 
+        should &quot;write properly without html extension&quot; do
+          post = setup_post(&quot;2008-10-18-foo-bar.textile&quot;)
+          post.site.permalink_style = &quot;:title&quot;
+          do_render(post)
+          post.write(dest_dir)
+
+          assert File.directory?(dest_dir)
+          assert File.exists?(File.join(dest_dir, 'foo-bar', 'index.html'))
+        end
+
         should &quot;insert data&quot; do
           post = setup_post(&quot;2008-11-21-complex.textile&quot;)
           do_render(post)
@@ -164,7 +296,6 @@ class TestPost &lt; Test::Unit::TestCase
     should &quot;generate categories and topics&quot; do
       post = Post.new(@site, File.join(File.dirname(__FILE__), *%w[source]), 'foo', 'bar/2008-12-12-topical-post.textile')
       assert_equal ['foo'], post.categories
-      assert_equal ['bar'], post.topics
     end
 
   end</diff>
      <filename>test/test_post.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,10 @@ class TestSite &lt; Test::Unit::TestCase
       @site = Site.new(Jekyll.configuration)
     end
 
+    should &quot;have an empty tag hash by default&quot; do
+      assert_equal Hash.new, @site.tags
+    end
+
     should &quot;reset data before processing&quot; do
       clear_dest
       @site.process
@@ -38,7 +42,7 @@ class TestSite &lt; Test::Unit::TestCase
       @site.process
 
       posts = Dir[source_dir(&quot;**&quot;, &quot;_posts&quot;, &quot;*&quot;)]
-      categories = %w(bar baz category foo z_category publish_test).sort
+      categories = %w(bar baz category foo z_category publish_test win).sort
 
       assert_equal posts.size - 1, @site.posts.size
       assert_equal categories, @site.categories.keys.sort
@@ -53,5 +57,29 @@ class TestSite &lt; Test::Unit::TestCase
       assert_equal %w[foo.markdown bar.markdown baz.markdown], @site.filter_entries(ent1)
       assert_equal ent2, @site.filter_entries(ent2)
     end
+
+    should &quot;filter entries with exclude&quot; do
+      excludes = %w[README TODO]
+      includes = %w[index.html site.css]
+
+      @site.exclude = excludes
+      assert_equal includes, @site.filter_entries(excludes + includes)
+    end
+    
+    context 'with an invalid markdown processor in the configuration' do
+      
+      should 'give a meaningful error message' do
+        bad_processor = 'not a processor name'
+        begin
+          Site.new(Jekyll.configuration.merge({ 'markdown' =&gt; bad_processor }))
+          flunk 'Invalid markdown processors should cause a failure on site creation'
+        rescue RuntimeError =&gt; e
+          assert e.to_s =~ /invalid|bad/i
+          assert e.to_s =~ %r{#{bad_processor}}
+        end
+      end
+      
+    end
+    
   end
 end</diff>
      <filename>test/test_site.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,35 +1,116 @@
 require File.dirname(__FILE__) + '/helper'
 
 class TestTags &lt; Test::Unit::TestCase
-  context &quot;tagging&quot; do
-    setup do
-      @content = &lt;&lt;CONTENT
+
+  def create_post(content, override = {}, markdown = true)
+    stub(Jekyll).configuration do
+      Jekyll::DEFAULTS.merge({'pygments' =&gt; true}).merge(override)
+    end
+    site = Site.new(Jekyll.configuration)
+    info = { :filters =&gt; [Jekyll::Filters], :registers =&gt; { :site =&gt; site } }
+
+    if markdown
+      payload = {&quot;content_type&quot; =&gt; &quot;markdown&quot;}
+    else
+      payload = {&quot;content_type&quot; =&gt; &quot;textile&quot;}
+    end
+
+    @result = Liquid::Template.parse(content).render(payload, info)
+
+    if markdown
+      @result = site.markdown(@result)
+    else
+      @result = site.textile(@result)
+    end
+  end
+
+  def fill_post(code, override = {})
+    content = &lt;&lt;CONTENT
 ---
-layout: post
 title: This is a test
-
 ---
+
 This document results in a markdown error with maruku
 
-{% highlight ruby %}
-puts &quot;hi&quot;
+{% highlight text %}
+#{code}
+{% endhighlight %}
+CONTENT
+    create_post(content, override)
+  end
+
+  context &quot;post content has highlight tag&quot; do
+    setup do
+      fill_post(&quot;test&quot;)
+    end
+
+    should &quot;not cause a markdown error&quot; do
+      assert_no_match /markdown\-html\-error/, @result
+    end
+
+    should &quot;render markdown with pygments line handling&quot; do
+      assert_match %{&lt;pre&gt;test\n&lt;/pre&gt;}, @result
+    end
+  end
 
-puts &quot;bye&quot;
+  context &quot;post content has highlight tag with UTF character&quot; do
+    setup do
+      fill_post(&quot;&#198;&quot;)
+    end
+
+    should &quot;render markdown with pygments line handling&quot; do
+      assert_match %{&lt;pre&gt;&#198;\n&lt;/pre&gt;}, @result
+    end
+  end
+
+  context &quot;simple post with markdown and pre tags&quot; do
+    setup do
+      @content = &lt;&lt;CONTENT
+---
+title: Maruku vs. RDiscount
+---
+
+_FIGHT!_
+
+{% highlight ruby %}
+puts &quot;3..2..1..&quot;
 {% endhighlight %}
 
+*FINISH HIM*
 CONTENT
     end
 
-    should &quot;render markdown with pygments line handling&quot; do
-      stub(Jekyll).configuration do
-        Jekyll::DEFAULTS.merge({'pygments' =&gt; true})
+    context &quot;using Textile&quot; do
+      setup do
+        create_post(@content, {}, false)
+      end
+
+      # Broken in RedCloth 4.1.9
+      should &quot;not textilize highlight block&quot; do
+        assert_no_match %r{3\.\.2\.\.1\.\.&amp;quot;&lt;/span&gt;&lt;br /&gt;}, @result
+      end
+    end
+
+    context &quot;using Maruku&quot; do
+      setup do
+        create_post(@content)
       end
-      site = Site.new(Jekyll.configuration)
-      info = { :filters =&gt; [Jekyll::Filters], :registers =&gt; { :site =&gt; site } }
 
-      result = Liquid::Template.parse(@content).render({}, info)
-      result = site.markdown(result)
-      assert_no_match(/markdown\-html\-error/,result)
+      should &quot;parse correctly&quot; do
+        assert_match %r{&lt;em&gt;FIGHT!&lt;/em&gt;}, @result
+        assert_match %r{&lt;em&gt;FINISH HIM&lt;/em&gt;}, @result
+      end
+    end
+
+    context &quot;using RDiscount&quot; do
+      setup do
+        create_post(@content, 'markdown' =&gt; 'rdiscount')
+      end
+
+      should &quot;parse correctly&quot; do
+        assert_match %r{&lt;em&gt;FIGHT!&lt;/em&gt;}, @result
+        assert_match %r{&lt;em&gt;FINISH HIM&lt;/em&gt;}, @result
+      end
     end
   end
 end</diff>
      <filename>test/test_tags.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>TODO</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>596f69a84b69d755b432585a310d46249dc4b482</id>
    </parent>
    <parent>
      <id>f1c8e388e406e2cc022354562d8bd683d1262072</id>
    </parent>
  </parents>
  <author>
    <name>sixones</name>
    <email>sixones@me.com</email>
  </author>
  <url>http://github.com/sixones/jekyll/commit/448d490c9ba3434c5cabe9f7a1f7b0a031c61994</url>
  <id>448d490c9ba3434c5cabe9f7a1f7b0a031c61994</id>
  <committed-date>2009-06-28T07:59:35-07:00</committed-date>
  <authored-date>2009-06-28T07:59:35-07:00</authored-date>
  <message>updated to use latest jekyll, fixed conflicts</message>
  <tree>15bb2f8a609ce464d2e0cb5913c4c2db397dbfd5</tree>
  <committer>
    <name>sixones</name>
    <email>sixones@me.com</email>
  </committer>
</commit>
