mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 10:15:47 +08:00
FIX: custom css not using CDN
This commit is contained in:
parent
8c68309b5a
commit
b2e29526ff
|
@ -179,14 +179,19 @@ class SiteCustomization < ActiveRecord::Base
|
||||||
return "" unless stylesheet.present?
|
return "" unless stylesheet.present?
|
||||||
return @stylesheet_link_tag if @stylesheet_link_tag
|
return @stylesheet_link_tag if @stylesheet_link_tag
|
||||||
ensure_stylesheets_on_disk!
|
ensure_stylesheets_on_disk!
|
||||||
@stylesheet_link_tag = "<link class=\"custom-css\" rel=\"stylesheet\" href=\"/#{CACHE_PATH}#{stylesheet_filename}?#{stylesheet_hash}\" type=\"text/css\" media=\"all\">"
|
@stylesheet_link_tag = link_css_tag "/#{CACHE_PATH}#{stylesheet_filename}?#{stylesheet_hash}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def mobile_stylesheet_link_tag
|
def mobile_stylesheet_link_tag
|
||||||
return "" unless mobile_stylesheet.present?
|
return "" unless mobile_stylesheet.present?
|
||||||
return @mobile_stylesheet_link_tag if @mobile_stylesheet_link_tag
|
return @mobile_stylesheet_link_tag if @mobile_stylesheet_link_tag
|
||||||
ensure_stylesheets_on_disk!
|
ensure_stylesheets_on_disk!
|
||||||
@mobile_stylesheet_link_tag = "<link class=\"custom-css\" rel=\"stylesheet\" href=\"/#{CACHE_PATH}#{stylesheet_filename(:mobile)}?#{stylesheet_hash(:mobile)}\" type=\"text/css\" media=\"all\">"
|
@mobile_stylesheet_link_tag = link_css_tag "/#{CACHE_PATH}#{stylesheet_filename(:mobile)}?#{stylesheet_hash(:mobile)}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def link_css_tag(href)
|
||||||
|
href = (GlobalSetting.cdn_url || "") + href
|
||||||
|
%Q{<link class="custom-css" rel="stylesheet" href="#{href}" type="text/css" media="all">}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user