0
0
Fork 0

Merge branch 'master' of github.com:Gibheer/zero-blog

This commit is contained in:
Gibheer 2011-06-30 21:39:49 +02:00
commit 14b6680ce4
5 changed files with 14 additions and 1 deletions

View File

@ -11,3 +11,4 @@ gem 'dm-postgres-adapter'
# the different markups
gem 'RedCloth'
gem 'rdiscount'

View File

@ -61,6 +61,7 @@ GEM
rack (1.3.0)
rack-flash (0.1.1)
rack
rdiscount (1.6.8)
sass (3.1.3)
sinatra (1.2.6)
rack (~> 1.1)
@ -81,6 +82,7 @@ DEPENDENCIES
dm-postgres-adapter
haml
rack-flash
rdiscount
sass
sinatra
sinatra-support

View File

@ -12,6 +12,7 @@ require 'rack-flash'
# markups
require 'redcloth'
require 'rdiscount'
require 'settings'

View File

@ -30,4 +30,13 @@ class Blog < Sinatra::Base
def link_to display, link
"<a href=\"${link}\">#{display}</a>"
end
def markup content, markup
markup= markup.to_sym
if respond_to? markup
send markup, content
else
content
end
end
end

View File

@ -2,4 +2,4 @@
%article
%header
%h1=post.title
%section.content=textile(post.content)
%section.content=markup(post.content, post.markup)