FIX: deliver discourse stylesheets over cdn
This commit is contained in:
parent
29acbfb611
commit
b713688ce2
|
@ -23,7 +23,7 @@ class DiscourseStylesheets
|
|||
builder = self.new(target)
|
||||
builder.compile unless File.exists?(builder.stylesheet_fullpath)
|
||||
builder.ensure_digestless_file
|
||||
tag = %[<link href="#{Rails.env.production? ? builder.stylesheet_relpath : builder.stylesheet_relpath_no_digest + '?body=1'}" media="all" rel="stylesheet" />]
|
||||
tag = %[<link href="#{Rails.env.production? ? builder.stylesheet_cdnpath : builder.stylesheet_relpath_no_digest + '?body=1'}" media="all" rel="stylesheet" />]
|
||||
|
||||
cache[target] = tag
|
||||
|
||||
|
@ -110,9 +110,14 @@ class DiscourseStylesheets
|
|||
"#{cache_fullpath}/#{stylesheet_filename_no_digest}"
|
||||
end
|
||||
|
||||
def stylesheet_cdnpath
|
||||
"#{GlobalSetting.cdn_url}#{stylesheet_relpath}?__ws#{Discourse.current_hostname}"
|
||||
end
|
||||
|
||||
def stylesheet_relpath
|
||||
"/#{CACHE_PATH}/#{stylesheet_filename}"
|
||||
end
|
||||
|
||||
def stylesheet_relpath_no_digest
|
||||
"/#{CACHE_PATH}/#{stylesheet_filename_no_digest}"
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue