Skip to content

Commit

Permalink
Create an about page whose text is in Markdown
Browse files Browse the repository at this point in the history
 - Add redcarpet as a dependency
 - Create generic markdown template
  • Loading branch information
icco committed Dec 16, 2013
1 parent 2f8c074 commit 49c27a8
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ gem 'openpgp'
gem 'rack-less', :require => 'rack/less'
gem 'rack-test', :require => 'rack/test', :group => 'test'
gem 'rake'
gem 'redcarpet'
gem 'rr', :group => 'test'
gem 'shotgun', :group => 'development'
gem 'sinatra', :require => 'sinatra/base'
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ GEM
rack-test (0.6.2)
rack (>= 1.0)
rake (10.1.0)
redcarpet (3.0.0)
ref (1.0.5)
rr (1.1.2)
shotgun (0.9)
Expand Down Expand Up @@ -67,6 +68,7 @@ DEPENDENCIES
rack-less
rack-test
rake
redcarpet
rr
shotgun
sinatra
Expand Down
3 changes: 2 additions & 1 deletion app/controllers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ class PgpIo::App < Sinatra::Application
end

get "/about" do
erb :about, :layout => :'layouts/main'
@text = markdown :about
erb :markdown, :layout => :'layouts/main'
end

# Append to a location
Expand Down
1 change: 0 additions & 1 deletion app/views/about.erb

This file was deleted.

1 change: 1 addition & 0 deletions app/views/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is our about page.
3 changes: 3 additions & 0 deletions app/views/markdown.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="markdown">
<%= @text %>
</div>

0 comments on commit 49c27a8

Please sign in to comment.