Commits

Koen Van der Auwera committed 567d954

Render a single post + links from archive page

Comments (0)

Files changed (1)

     end
   end
 
+  class Post < R '/(\d{4})/(\d{2})/(\d{2})/(\d{4})(/?.*)?'
+    def get(year, month, day, time, rest)
+      @post = STORE.post("#{year}#{month}#{day}#{time}")
+      render :single
+    end
+  end
+
   class Refresh < R '/refresh'
     def get
       STORE.refresh_from_dropbox
     STORE.keys "*"
   end
 
+  def single
+    @post.title
+  end
+
   def archive
     ul do
-      STORE.posts.map {|p| li(p.title)}
+      STORE.posts.map {|p| li {a(href: URL(p.to_param).to_s, title: p.title) { p.title }}}
     end
   end
 end