This commit is contained in:
BoHung Chiu 2022-10-24 19:47:21 +08:00
parent 9cb912be75
commit b9d900f9d7
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ class PageContentsController < OrbitAdminController
img_srcs = doc.css('img').map{ |i| i['src'] }
metas = [{"property" => "og:title", "content" => name},{"property" => "og:site_name", "content" => Site.first.title},{"property" => "og:url", "content" => request.original_url},{"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, img_srcs[0])}
metas << {"property" => "og:image", "content" => URI.join(request.base_url, img_srcs[0]).to_s}
end
OrbitHelper.render_meta_tags(metas)