diff --git a/Gemfile b/Gemfile index 081cd08..ae9f18b 100644 --- a/Gemfile +++ b/Gemfile @@ -13,6 +13,7 @@ gem "puma" gem "rack-canonical-host" gem "rails", "~> 5.0.0" gem "recipient_interceptor" +gem "redcarpet" gem "sass-rails", "~> 5.0" gem "simple_form" gem "skylight" diff --git a/Gemfile.lock b/Gemfile.lock index e46f38e..f498ec1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -187,6 +187,7 @@ GEM ffi (>= 0.5.0) recipient_interceptor (0.1.2) mail + redcarpet (3.3.4) refills (0.2.0) rspec-core (3.5.3) rspec-support (~> 3.5.0) @@ -304,6 +305,7 @@ DEPENDENCIES rails (~> 5.0.0) rails_stdout_logging recipient_interceptor + redcarpet refills rspec-rails (~> 3.5.0.beta4) sass-rails (~> 5.0) diff --git a/app/assets/stylesheets/_layout.scss b/app/assets/stylesheets/_layout.scss index 724a09e..fa20080 100644 --- a/app/assets/stylesheets/_layout.scss +++ b/app/assets/stylesheets/_layout.scss @@ -1,8 +1,13 @@ .content { @include outer-container; + padding: $base-spacing 0; } .left-column, .right-column { - @include span-columns(6 of 12); + @include span-columns(5.5 of 12); +} + +.right-column { + @include shift(1); } diff --git a/app/assets/stylesheets/base/_lists.scss b/app/assets/stylesheets/base/_lists.scss index 06a7c0a..53725d3 100644 --- a/app/assets/stylesheets/base/_lists.scss +++ b/app/assets/stylesheets/base/_lists.scss @@ -1,10 +1,3 @@ -ul, -ol { - list-style-type: none; - margin: 0; - padding: 0; -} - dl { margin: 0; } diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index addf74c..5fdd0e4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,4 +1,8 @@ module ApplicationHelper + def markdown(source) + Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(source).html_safe + end + def expiration_time if Post.any? Post.order(created_at: :desc).first.created_at + 7.days diff --git a/app/views/posts/index.html.erb b/app/views/posts/index.html.erb index 497a19b..0a7eca9 100644 --- a/app/views/posts/index.html.erb +++ b/app/views/posts/index.html.erb @@ -2,6 +2,6 @@
<%= link_to post.title, post, class: "post-title" %>
<%= l(post.created_at) %>
- <%= simple_format post.body.truncate(300) %> + <%= markdown post.body.truncate(300) %>
<% end %> diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb index ee828f0..4b0cc9d 100644 --- a/app/views/posts/show.html.erb +++ b/app/views/posts/show.html.erb @@ -8,7 +8,7 @@
<%= l(@post.created_at) %>
- <%= simple_format @post.body %> + <%= markdown @post.body %>
<%= link_to "Back", posts_path %>