Fix bug.
This commit is contained in:
parent
d60851d28c
commit
8b71e8e54f
|
@ -1,4 +1,5 @@
|
||||||
class PageContentsController < OrbitAdminController
|
class PageContentsController < OrbitAdminController
|
||||||
|
require 'uri'
|
||||||
def index
|
def index
|
||||||
params = OrbitHelper.params
|
params = OrbitHelper.params
|
||||||
if params["wiki"].present?
|
if params["wiki"].present?
|
||||||
|
@ -20,7 +21,7 @@ class PageContentsController < OrbitAdminController
|
||||||
img_srcs = doc.css('img').map{ |i| i['src'] }
|
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"}]
|
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
|
if img_srcs.count > 0
|
||||||
metas << {"property" => "og:image", "content" => "#{request.base_url}#{img_srcs[0]}"}
|
metas << {"property" => "og:image", "content" => URI.join(request.base_url, img_srcs[0])}
|
||||||
end
|
end
|
||||||
OrbitHelper.render_meta_tags(metas)
|
OrbitHelper.render_meta_tags(metas)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue