Merge pull request #2202 from wairbut-m2c/aperez-social-metatags

Use 'image_url' properties to improve SEO for proposals & investments
This commit is contained in:
Raimond Garcia
2018-01-08 18:33:07 +01:00
committed by GitHub
2 changed files with 12 additions and 1 deletions

View File

@@ -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) %>"> <section class="budget-investment-show" id="<%= dom_id(investment) %>">
<div class="row"> <div class="row">

View File

@@ -4,7 +4,9 @@
<%= render "shared/social_media_meta_tags", <%= render "shared/social_media_meta_tags",
social_url: proposal_url(@proposal), social_url: proposal_url(@proposal),
social_title: @proposal.title, 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 %> <% end %>
<% content_for :canonical do %> <% content_for :canonical do %>
<%= render "shared/canonical", href: proposal_url(@proposal) %> <%= render "shared/canonical", href: proposal_url(@proposal) %>