Merge branch 'master' of github.com:Gibheer/zero-blog
This commit is contained in:
commit
14b6680ce4
1
Gemfile
1
Gemfile
|
@ -11,3 +11,4 @@ gem 'dm-postgres-adapter'
|
|||
|
||||
# the different markups
|
||||
gem 'RedCloth'
|
||||
gem 'rdiscount'
|
||||
|
|
|
@ -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
|
||||
|
|
1
libs.rb
1
libs.rb
|
@ -12,6 +12,7 @@ require 'rack-flash'
|
|||
|
||||
# markups
|
||||
require 'redcloth'
|
||||
require 'rdiscount'
|
||||
|
||||
require 'settings'
|
||||
|
||||
|
|
9
page.rb
9
page.rb
|
@ -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
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
%article
|
||||
%header
|
||||
%h1=post.title
|
||||
%section.content=textile(post.content)
|
||||
%section.content=markup(post.content, post.markup)
|
||||
|
|
Loading…
Reference in New Issue