mirror of
https://github.com/discourse/discourse.git
synced 2024-12-04 01:53:45 +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 @stylesheet_link_tag if @stylesheet_link_tag
|
||||
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
|
||||
|
||||
def mobile_stylesheet_link_tag
|
||||
return "" unless mobile_stylesheet.present?
|
||||
return @mobile_stylesheet_link_tag if @mobile_stylesheet_link_tag
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user