Skip to content

Commit

Permalink
Merge pull request consuldemocracy#2202 from wairbut-m2c/aperez-socia…
Browse files Browse the repository at this point in the history
…l-metatags

Use 'image_url' properties to improve SEO for proposals & investments
  • Loading branch information
voodoorai2000 committed Jan 8, 2018
2 parents 1cf25a5 + adc90a5 commit 1234a6a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions app/views/budgets/investments/_investment_show.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<% provide :social_media_meta_tags do %>
<%= render "shared/social_media_meta_tags",
social_url: budget_investments_path(investment),
social_title: investment.title,
social_description: investment.description,
twitter_image_url: (investment.image.present? ? investment.image_url(:thumb) : nil),
og_image_url: (investment.image.present? ? investment.image_url(:thumb) : nil) %>
<% end %>

<section class="budget-investment-show" id="<%= dom_id(investment) %>">

<div class="row">
Expand Down
4 changes: 3 additions & 1 deletion app/views/proposals/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<%= render "shared/social_media_meta_tags",
social_url: proposal_url(@proposal),
social_title: @proposal.title,
social_description: @proposal.summary %>
social_description: @proposal.summary,
twitter_image_url: (@proposal.image.present? ? @proposal.image_url(:thumb) : nil),
og_image_url: (@proposal.image.present? ? @proposal.image_url(:thumb) : nil) %>
<% end %>
<% content_for :canonical do %>
<%= render "shared/canonical", href: proposal_url(@proposal) %>
Expand Down

0 comments on commit 1234a6a

Please sign in to comment.