mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 04:18:27 +08:00
Include cdn path in the stylesheet digest.
This commit is contained in:
@ -59,7 +59,7 @@ class DiscourseStylesheets
|
||||
def self.max_file_mtime
|
||||
globs = ["#{Rails.root}/app/assets/stylesheets/**/*.*css"]
|
||||
|
||||
for path in (Discourse.plugins || []).map { |plugin| File.dirname(plugin.path) }
|
||||
Discourse.plugins.map { |plugin| File.dirname(plugin.path) }.each do |path|
|
||||
globs += [
|
||||
"#{path}/plugin.rb",
|
||||
"#{path}/**/*.*css",
|
||||
@ -71,8 +71,6 @@ class DiscourseStylesheets
|
||||
end.compact.max.to_i
|
||||
end
|
||||
|
||||
|
||||
|
||||
def initialize(target = :desktop)
|
||||
@target = target
|
||||
end
|
||||
@ -167,7 +165,13 @@ class DiscourseStylesheets
|
||||
if theme || category_updated > 0
|
||||
Digest::SHA1.hexdigest "#{RailsMultisite::ConnectionManagement.current_db}-#{theme}-#{DiscourseStylesheets.last_file_updated}-#{category_updated}"
|
||||
else
|
||||
Digest::SHA1.hexdigest "defaults-#{DiscourseStylesheets.last_file_updated}"
|
||||
digest_string = "defaults-#{DiscourseStylesheets.last_file_updated}"
|
||||
|
||||
if cdn_url = GlobalSetting.cdn_url
|
||||
digest_string = "#{digest_string}-#{cdn_url}"
|
||||
end
|
||||
|
||||
Digest::SHA1.hexdigest digest_string
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user