small change for facebook meta tags

This commit is contained in:
Harry Bomrah 2015-07-03 19:53:24 +08:00
parent 69c0959b31
commit 77a804f925
1 changed files with 5 additions and 0 deletions

View File

@ -135,6 +135,11 @@ class AnnouncementsController < ApplicationController
update_user = announcement.update_user.member_profile.name rescue "" update_user = announcement.update_user.member_profile.name rescue ""
desc = announcement.image_description desc = announcement.image_description
desc = (desc.nil? || desc == "" ? "announcement image" : desc) desc = (desc.nil? || desc == "" ? "announcement image" : desc)
request = OrbitHelper.request
meta_desc = announcement.subtitle.nil? || announcement.subtitle == "" ? announcement.text[0..200] : announcement.subtitle
OrbitHelper.render_meta_tags([{"property" => "og:title", "content" => announcement.title},{"property" => "og:site_name", "content" => Site.first.title},{"property" => "og:url", "content" => request.original_url},{"property" => "og:description", "content" => meta_desc},{"property" => "og:image", "content" => "#{request.base_url}#{announcement.image.url}"},{"property" => "og:type", "content" => "Article"}])
{ {
"tags" => tags, "tags" => tags,
"bulletin_files" => files, "bulletin_files" => files,