about summary refs log tree commit diff stats
path: root/app/controllers/blogs_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/blogs_controller.rb')
-rw-r--r--app/controllers/blogs_controller.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/controllers/blogs_controller.rb b/app/controllers/blogs_controller.rb index 39a578a..0d218ae 100644 --- a/app/controllers/blogs_controller.rb +++ b/app/controllers/blogs_controller.rb
@@ -1,3 +1,5 @@
1require 'redcarpet/render_strip'
2
1class BlogsController < ApplicationController 3class BlogsController < ApplicationController
2 4
3 def summary 5 def summary
@@ -21,6 +23,19 @@ class BlogsController < ApplicationController
21 23
22 raise ActiveRecord::RecordNotFound unless @blog 24 raise ActiveRecord::RecordNotFound unless @blog
23 raise ActiveRecord::RecordNotFound unless @blog.published 25 raise ActiveRecord::RecordNotFound unless @blog.published
26
27 body = Redcarpet::Markdown.new(Redcarpet::Render::StripDown).render(@blog.body)
28
29 set_meta_tags(og: {
30 title: @blog.title,
31 type: "article",
32 description: (body.length <= 300 ? body : body[0..299]),
33 url: blog_url(@blog, host: "www.fourisland.com"),
34 article: {
35 published_time: @blog.published_at.iso8601,
36 modified_time: @blog.updated_at.iso8601
37 }
38 })
24 end 39 end
25 40
26end 41end