Add support for twitter cards and facebook shares

Added missing image url as well as created twitter card.
validated both with twitter validator and facebook validator.
All passed.

Need to check to see if no image is selected, what is outcome.
This commit is contained in:
robotscissors 2018-05-15 21:21:00 -07:00
parent b092790ea2
commit 1b871acae0
2 changed files with 11 additions and 2 deletions

View file

@ -28,6 +28,8 @@ class ConferencesController < ApplicationController
redirect_to admin_conference_splashpage_path(@conference.short_title) && return
end
@image_url = "#{request.protocol}#{request.host}#{@conference.picture}"
if splashpage.include_cfp
cfps = @conference.program.cfps
@call_for_events = cfps.find { |call| call.cfp_type == 'events' }

View file

@ -3,13 +3,19 @@
%meta{ property: "og:site_name", content: (ENV['OSEM_NAME'] || 'OSEM') }
%meta{ property: "og:description", content: @conference.description }
%meta{ property: "og:url", content: conference_url(@conference.short_title) }
%meta{ property: "twitter:card", content: "summary_large_image" }
%meta{ property: "twitter:image", content: @image_url }
%meta{ property: "twitter:title", content: (@conference.title) }
%meta{ property: "twitter:description", content: @conference.description }
- if @conference.picture?
%meta{ property: "og:image", content: @conference.picture_url }
%meta{ property: "og:image:secure_url", content: @conference.picture_url }
%meta{ property: "og:image", content: @image_url }
%meta{ property: "og:image:secure_url", content: @image_url }
= content_for :title do
= @conference.title
#splash
- if @conference.code_of_conduct.present?
= render 'code_of_conduct', organization: @conference.organization
@ -50,6 +56,7 @@
sponsorship_levels: @sponsorship_levels,
sponsors: @sponsors
-# footer
- if @conference.splashpage.include_social_media
- if @conference.contact.has_social_media?