Update 'app/controllers/page_contents_controller.rb'

Update to remove image from ogtag
This commit is contained in:
Harry Bomrah 2023-09-23 10:07:22 +00:00
parent acfd3b7fce
commit 93272f9eaf
1 changed files with 3 additions and 3 deletions

View File

@ -20,9 +20,9 @@ class PageContentsController < OrbitAdminController
doc = Nokogiri::HTML( html )
img_srcs = doc.css('img').map{ |i| i['src'] }.compact
metas = [{"property" => "og:description", "content" => meta_desc},{"property" => "og:type", "content" => "Article"}]
if img_srcs.count > 0
metas << {"property" => "og:image", "content" => URI.join(request.base_url, URI.encode(img_srcs[0])).to_s}
end
# if img_srcs.count > 0
# metas << {"property" => "og:image", "content" => URI.join(request.base_url, URI.encode(img_srcs[0])).to_s}
# end
OrbitHelper.render_meta_tags(metas)
{