<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/templates/_comments.rhtml</filename>
    </added>
    <added>
      <filename>test/templates/archive.rhtml</filename>
    </added>
    <added>
      <filename>test/templates/category.rhtml</filename>
    </added>
    <added>
      <filename>test/templates/category.rxml</filename>
    </added>
    <added>
      <filename>test/templates/index.rhtml</filename>
    </added>
    <added>
      <filename>test/templates/index.rxml</filename>
    </added>
    <added>
      <filename>test/templates/layout.rhtml</filename>
    </added>
    <added>
      <filename>test/templates/page.rhtml</filename>
    </added>
    <added>
      <filename>test/templates/post.rhtml</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,4 @@
 *~
 doc/*
 pkg/*
+test/repo</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -1,19 +1,23 @@
-Shinmun, the git-based blog engine
+Shinmun - a git-based blog engine
 ==========================================
 
-Shinmun is a **minimalist blog engine**. You just write posts as text
-files and serve your blog straight from a git repository. You write
-posts in your favorite editor like Emacs or VI and deploy via 
-`git push`.
+Shinmun is a small git-based blog engine. Write posts in your favorite
+editor, git-push it and serve your blog straight from a
+repository.
+
 
 ### Features
 
+* Posts are text files formatted with [Markdown][8], [Textile][9] or [HTML][10]
+* Runs on [Rack][6], [Kontrol][3] and [GitStore][7]
+* Deploy via [git-push][11]
 * Index, category and archive listings
 * RSS feeds
 * Flickr and Delicious aggregations
-* Runs on Rack via [Kontrol][3]
-* Syntax highlighting provided by CodeRay
+* Syntax highlighting provided by [CodeRay][4]
 * AJAX comment system with Markdown preview
+* Web frontend using [WMD Editor][12]
+
 
 ### Quickstart
 
@@ -55,7 +59,8 @@ your new article.
 ### Post Format
 
 Each blog post is just a text file with a YAML header and a body. The
-YAML header is surrounded with 2 lines of 3 dashes.
+YAML header is surrounded with 2 lines of 3 dashes. This format is
+compatible with [Jekyll][13] and [Github Pages][14].
 
 The YAML header has following attributes:
 
@@ -150,17 +155,15 @@ Inside `config/blog.yml` you set the properties of your blog:
 * url: used for RSS
 * categories: a list of categories
 
+
 ### Assets
 
-By default Shinmun serves asset files from your assets directory. If
-you want some other behaviour, you can tweak the `map.rb` file in your
-blog folder, which contains all routes.
+Shinmun serves asset files from your assets directory. Files in the
+directories `assets/stylesheets` and `assets/javascripts` will be
+served as one file each under the URLs `assets/stylesheets.css` and
+`assets/javascripts.css`. You have to name them accordingly like
+`1-reset.css` and `2-typo.css` to define the order.
 
-If you set the variables `javascripts_files` or `stylesheets_files` in
-`config/asstes.yml`, Shinmun will serve the javascripts as
-`assets/javascripts.js` and stylesheets as `assets/stylesheets.css`
-automatically. Both variables should be arrays of the filenames
-without extension.
 
 ### Templates
 
@@ -168,6 +171,8 @@ Layout and templates are rendered by *ERB*.  The layout is defined in
 `templates/layout.rhtml`. The content will be provided in the variable
 `@content`. A minimal example:
 
+    @@rhtml
+
     &lt;html&gt;
       &lt;head&gt;
         &lt;title&gt;&lt;%= @blog.title %&gt;&lt;/title&gt;
@@ -181,6 +186,8 @@ Layout and templates are rendered by *ERB*.  The layout is defined in
 The attributes of a post are accessible as instance variables in a
 template:
 
+    @@rhtml
+
     &lt;div class=&quot;article&quot;&gt;    
       &lt;div class=&quot;date&quot;&gt;
         &lt;%= date @date %&gt;
@@ -200,6 +207,7 @@ post&gt;`. So administration of comments is possible by editing the YAML
 file, which can be done on your local machine, as you can just pull
 the comments from your live server.
 
+
 ### Deployment
 
 Shinmun can server the blog straight from the git repository. So on
@@ -230,6 +238,7 @@ just write, commit and finally push a post by:
     $ git commit -a -m 'new post'
     $ git push live
 
+
 ### Phusion Passenger
 
 Shinmun is compatible with [Phusion Passenger][5]. Install Phusion
@@ -238,6 +247,8 @@ Passenger as described in my [blog post][2].
 Assuming that you are on a Debian or Ubuntu system, you can create a
 file named `/etc/apache2/sites-available/blog`:
 
+    @@xml
+
     &lt;VirtualHost *:80&gt;
         ServerName myblog.com
         DocumentRoot /var/www/blog/public
@@ -255,13 +266,11 @@ domain:
 
 ### Web Frontend
 
-The example blog has a builtin web frontend. To activate you have to
-create a file named `password` with a single password inside. Now
-browse to `/admin` and login using some arbitrary username and your
-password.
+The example blog has a builtin web frontend. Currently it only works
+on localhost:9292.
 
 The frontend allows you to create, edit, read or delete posts or
-pages. Editing a post shows up a form with the [wmd editor][6]. You
+pages. Editing a post shows up a form with the [wmd editor][12]. You
 have to look yourself for a correct YAML header, otherwise you will
 get incorrect results.
 
@@ -271,7 +280,7 @@ single commit overview, where you can inspect changes introduced by
 this particular commit.
 
 
-### Download
+### GitHub Project
 
 Download or fork the package at my [github repository][1]
 
@@ -281,4 +290,12 @@ Download or fork the package at my [github repository][1]
 [3]: http://github.com/georgi/kontrol
 [4]: http://coderay.rubychan.de/
 [5]: http://www.modrails.com/
-[6]: http://wmd-editor.com/
+[6]: http://github.com/rack/rack
+[7]: http://github.com/georgi/git_store
+[8]: http://daringfireball.net/projects/markdown/
+[9]: http://textile.thresholdstate.com/
+[10]: http://en.wikipedia.org/wiki/Html
+[11]: http://www.kernel.org/pub/software/scm/git/docs/git-push.html
+[12]: http://wmd-editor.com/
+[13]: http://github.com/mojombo/jekyll
+[14]: http://github.com/blog/272-github-pages</diff>
      <filename>README.md</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,7 @@ require 'rubypants'
 require 'coderay'
 require 'kontrol'
 require 'git_store'
+require 'grit'
 
 begin; require 'redcloth'; rescue LoadError; end
 </diff>
      <filename>lib/shinmun.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ module Shinmun
 
     include Helpers
 
-    attr_reader :aggregations, :categories, :comments
+    attr_reader :aggregations, :categories, :comments, :repo
 
     %w[ assets comments config posts pages ].each do |name|
       define_method(name) { store.root.tree(name) }
@@ -21,6 +21,7 @@ module Shinmun
       super
 
       @aggregations = {}
+      @repo = Grit::Repo.new(path)
       
       Thread.start do
         loop do
@@ -45,13 +46,17 @@ module Shinmun
       end
     end
 
+    def posts_by_date
+      posts.sort_by { |post| post.date.to_s }.reverse
+    end
+
     def recent_posts
-      posts.sort_by { |post| post.date.to_s }.reverse[0, 20]
+      posts_by_date[0, 20]
     end
 
     # Return all posts for a given month.
     def posts_for_month(year, month)
-      posts.select { |p| p.year == year and p.month == month }.sort_by { |p| p.date.to_s }
+      posts_by_date.select { |p| p.year == year and p.month == month }
     end
 
     # Return all posts with any of given tags.
@@ -142,6 +147,11 @@ module Shinmun
     def render(name, vars = {})
       super(name, vars.merge(:blog =&gt; self))
     end
+
+    def call(env)
+      templates['helpers.rb']
+      super
+    end
     
   end  
   </diff>
      <filename>lib/shinmun/blog.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,11 +22,11 @@ Shinmun::Blog.map do
   end
 
   post '/comments' do
-    if params['preview']
+    if params['preview'] == 'true'
       render '_comments.rhtml', :comments =&gt; [Shinmun::Comment.new(params)]
     else
       post_comment(params['path'], params)
-      render '_comments.rhtml', :comments =&gt; comments_for(path)
+      render '_comments.rhtml', :comments =&gt; comments_for(params['path'])
     end    
   end
 
@@ -46,12 +46,18 @@ Shinmun::Blog.map do
   end
 
   map '/admin' do
-    use Rack::Auth::Basic do |username, password|
-      File.read(File.join(File.dirname(__FILE__), &quot;password&quot;)).chomp(&quot;\n&quot;) == password
-    end
+    use(Class.new do
+          def initialize(app); @app = app; end
+          def call(env)
+            if env['HTTP_HOST'] == 'localhost:9292'
+              @app.call(env)
+            else
+              [401, {}, '&lt;h1&gt;Not Allowed&lt;/h1&gt;']
+            end
+          end
+        end)
 
     get '/posts/(.*)' do |page|
-      session[:admin] = true
       render 'admin/posts.rhtml', :posts =&gt; posts_by_date, :page =&gt; page.to_i, :page_size =&gt; 10
     end
 </diff>
      <filename>lib/shinmun/routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 Gem::Specification.new do |s|
   s.name = 'shinmun'
-  s.version = '0.3.3'
+  s.version = '0.3.4'
   s.date = '2008-12-17'
   s.summary = 'git-based blog engine'
   s.author = 'Matthias Georgi'
@@ -22,66 +22,77 @@ LICENSE
 README.md
 Rakefile
 bin/shinmun
+example/
+example/pages
+example/pages/about.md
+example/posts
+example/posts/2009
+example/posts/2009/1
 example/Rakefile
+example/templates
+example/templates/index.rhtml
+example/templates/page.rhtml
+example/templates/_comments.rhtml
+example/templates/category.rhtml
+example/templates/_comment_form.rhtml
+example/templates/post.rhtml
+example/templates/index.rxml
+example/templates/admin
+example/templates/admin/commit.rhtml
+example/templates/admin/posts.rhtml
+example/templates/admin/pages.rhtml
+example/templates/admin/edit.rhtml
+example/templates/admin/commits.rhtml
+example/templates/category.rxml
+example/templates/_pagination.rhtml
+example/templates/layout.rhtml
+example/comments
+example/assets
+example/assets/images
 example/assets/images/favicon.ico
 example/assets/images/loading.gif
-example/assets/javascripts/coderay.js
-example/assets/javascripts/comments.js
-example/assets/javascripts/jquery-form.min.js
-example/assets/javascripts/jquery.min.js
-example/assets/stylesheets/article.css
-example/assets/stylesheets/coderay.css
-example/assets/stylesheets/comments.css
-example/assets/stylesheets/form.css
-example/assets/stylesheets/list.css
-example/assets/stylesheets/print.css
-example/assets/stylesheets/reset.css
-example/assets/stylesheets/style.css
-example/assets/stylesheets/table.css
-example/assets/stylesheets/typo.css
+example/assets/stylesheets
+example/assets/stylesheets/7-diff.css
+example/assets/stylesheets/8-blog.css
+example/assets/stylesheets/6-comments.css
+example/assets/stylesheets/5-coderay.css
+example/assets/stylesheets/1-reset.css
+example/assets/stylesheets/3-table.css
+example/assets/stylesheets/4-article.css
+example/assets/stylesheets/2-typo.css
+example/assets/print.css
+example/assets/wmd
+example/assets/wmd/images
+example/assets/wmd/images/wmd.png
 example/assets/wmd/images/bg-fill.png
-example/assets/wmd/images/bg.png
-example/assets/wmd/images/blockquote.png
+example/assets/wmd/images/italic.png
+example/assets/wmd/images/h1.png
+example/assets/wmd/images/wmd-on.png
+example/assets/wmd/images/undo.png
+example/assets/wmd/images/link.png
 example/assets/wmd/images/bold.png
+example/assets/wmd/images/ul.png
+example/assets/wmd/images/img.png
+example/assets/wmd/images/blockquote.png
 example/assets/wmd/images/code.png
-example/assets/wmd/images/h1.png
 example/assets/wmd/images/hr.png
-example/assets/wmd/images/img.png
-example/assets/wmd/images/italic.png
-example/assets/wmd/images/link.png
-example/assets/wmd/images/ol.png
-example/assets/wmd/images/redo.png
+example/assets/wmd/images/bg.png
 example/assets/wmd/images/separator.png
-example/assets/wmd/images/ul.png
-example/assets/wmd/images/undo.png
-example/assets/wmd/images/wmd-on.png
-example/assets/wmd/images/wmd.png
+example/assets/wmd/images/redo.png
+example/assets/wmd/images/ol.png
 example/assets/wmd/showdown.js
-example/assets/wmd/wmd-base.js
 example/assets/wmd/wmd-plus.js
+example/assets/wmd/wmd-base.js
 example/assets/wmd/wmd.js
+example/assets/javascripts
+example/assets/javascripts/2-jquery-form.min.js
+example/assets/javascripts/1-jquery.min.js
+example/assets/javascripts/4-coderay.js
+example/assets/javascripts/3-comments.js
 example/config.ru
-example/config/aggregations.yml
-example/config/assets.yml
+example/config
 example/config/blog.yml
-example/map.rb
-example/pages/about.md
 example/password
-example/templates/_comment_form.rhtml
-example/templates/_comments.rhtml
-example/templates/_pagination.rhtml
-example/templates/admin/commit.rhtml
-example/templates/admin/commits.rhtml
-example/templates/admin/edit.rhtml
-example/templates/admin/pages.rhtml
-example/templates/admin/posts.rhtml
-example/templates/category.rhtml
-example/templates/category.rxml
-example/templates/index.rhtml
-example/templates/index.rxml
-example/templates/layout.rhtml
-example/templates/page.rhtml
-example/templates/post.rhtml
 lib/shinmun.rb
 lib/shinmun/aggregations/delicious.rb
 lib/shinmun/aggregations/flickr.rb
@@ -91,17 +102,19 @@ lib/shinmun/comment.rb
 lib/shinmun/helpers.rb
 lib/shinmun/post.rb
 lib/shinmun/post_handler.rb
-templates/_comments.rhtml
-templates/archive.rhtml
-templates/category.rhtml
-templates/category.rxml
-templates/index.rhtml
-templates/index.rxml
-templates/layout.rhtml
-templates/page.rhtml
-templates/post.rhtml
+test
+test/templates
+test/templates/index.rhtml
+test/templates/page.rhtml
+test/templates/_comments.rhtml
+test/templates/category.rhtml
+test/templates/post.rhtml
+test/templates/index.rxml
+test/templates/category.rxml
+test/templates/archive.rhtml
+test/templates/layout.rhtml
 test/blog_spec.rb
-test/map.rb
+test/post_spec.rb
 }
 end
 </diff>
      <filename>shinmun.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -20,8 +20,6 @@ describe Shinmun::Blog do
     FileUtils.mkpath(File.dirname(file))
     open(file, 'w') { |io| io &lt;&lt; data }
     `git add #{file}`
-    `git commit -m 'added #{file}'`
-    File.unlink(file)
   end
 
   def initialize_blog
@@ -36,6 +34,7 @@ describe Shinmun::Blog do
       'categories' =&gt; ['Ruby', 'Javascript']
     }.to_yaml
 
+    ENV['RACK_ENV'] = 'production'
     @blog = Shinmun::Blog.new(REPO)
     @request = Rack::MockRequest.new(@blog)
 
@@ -46,6 +45,8 @@ describe Shinmun::Blog do
         file 'templates/' + File.basename(path), File.read(path)
       end
     end
+
+    `git commit -m 'spec'` 
     
     @blog.store.load
 
@@ -54,8 +55,8 @@ describe Shinmun::Blog do
               @blog.create_post(:title =&gt; 'Again',    :date =&gt; '2008-11-10', :category =&gt; 'Javascript', :body =&gt; 'Body3')]
 
     @pages = [@blog.create_post(:title =&gt; 'Page 1', :body =&gt; 'Body1'),
-              @blog.create_post(:title =&gt; 'Page 2', :body =&gt; 'Body2')]    
-    
+              @blog.create_post(:title =&gt; 'Page 2', :body =&gt; 'Body2')]
+
     @blog.store.load
   end
 
@@ -85,8 +86,7 @@ describe Shinmun::Blog do
     end
   end 
 
-  it &quot;should find posts for a category&quot; do
-    
+  it &quot;should find posts for a category&quot; do    
     category = @blog.find_category('ruby')
     category[:name].should == 'Ruby'
     
@@ -170,10 +170,9 @@ describe Shinmun::Blog do
     xpath(xml, &quot;//p&quot;)[0].text.should == 'Body2'
   end
 
-  it &quot;should post a comment&quot; do
-    
-    post &quot;/comments/posts/2008/10/new-post.md?name=Hans&amp;text=Hallo&quot;
-    post &quot;/comments/posts/2008/10/new-post.md?name=Peter&amp;text=Servus&quot;
+  it &quot;should post a comment&quot; do    
+    post &quot;/comments?path=posts/2008/10/new-post.md&amp;name=Hans&amp;text=Hallo&quot;
+    post &quot;/comments?path=posts/2008/10/new-post.md&amp;name=Peter&amp;text=Servus&quot;
     
     @blog.store.load
 </diff>
      <filename>test/blog_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e690e2e60f6b4d9da8fbed89ef54f85e665d1727</id>
    </parent>
  </parents>
  <author>
    <name>Matthias Georgi</name>
    <email>matti.georgi@gmail.com</email>
  </author>
  <url>http://github.com/georgi/shinmun/commit/ce8a3a5c01b839942dc9afc1b945d8e1aaf0f4d2</url>
  <id>ce8a3a5c01b839942dc9afc1b945d8e1aaf0f4d2</id>
  <committed-date>2009-01-06T16:03:24-08:00</committed-date>
  <authored-date>2009-01-06T16:03:24-08:00</authored-date>
  <message>moved test templates. added routes. fixed README.</message>
  <tree>5a7b7568a1e2006a5fb8b8eeab4c9148a78b56ba</tree>
  <committer>
    <name>Matthias Georgi</name>
    <email>matti.georgi@gmail.com</email>
  </committer>
</commit>
