This commit is contained in:
BoHung Chiu 2022-12-29 10:25:57 +08:00
parent b9d900f9d7
commit cfd1aa85b7
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]).to_s}
metas << {"property" => "og:image", "content" => URI.join(request.base_url, URI.encode(img_srcs[0])).to_s}
end
OrbitHelper.render_meta_tags(metas)