Skip to content

Commit

Permalink
Growstuff#816 For a comments, add opengraph
Browse files Browse the repository at this point in the history
  • Loading branch information
CloCkWeRX committed Mar 28, 2016
1 parent d9423d5 commit a88dad7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/views/comments/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
= content_for :title, @comment.post.subject
- content_for :opengraph do
<meta property="og:image" content="#{avatar_uri(@comment.post.author, 150)}"/>
<meta property="og:image:user_generated" content="true" />
<meta property="og:title" content="#{@comment.post.subject}" />
<meta property="og:description" content="#{ strip_tags @comment.post.body.split(' ')[0..20].join(' ') }" />
<meta property="og:type" content="website" />
<meta property="og:url" content="#{request.original_url}" />
<meta property="og:site_name" content="#{ENV['GROWSTUFF_SITE_NAME']}" />

= render :partial => "posts/single", :locals => { :post => @comment.post }

Expand Down

0 comments on commit a88dad7

Please sign in to comment.