tests passing
This commit is contained in:
parent
2400c670b4
commit
b1d300718f
17 changed files with 225 additions and 233 deletions
|
@ -1,15 +1,13 @@
|
|||
class Middleman::Base
|
||||
class << Middleman::Base
|
||||
alias_method :pre_cache_buster_asset_url, :asset_url
|
||||
helpers do
|
||||
def asset_url(path, prefix="")
|
||||
http_path = pre_cache_buster_asset_url(path, prefix)
|
||||
if http_path.include?("://") || !%w(.css .png .jpg .js .gif).include?(File.extname(http_path))
|
||||
http_path
|
||||
else
|
||||
real_path = File.join(self.class.environment == "build" ? options.build_dir : options.public, prefix, path)
|
||||
http_path << "?" + File.mtime(real_path).strftime("%s") if File.readable?(real_path)
|
||||
http_path
|
||||
end
|
||||
def asset_url(path, prefix="")
|
||||
http_path = pre_cache_buster_asset_url(path, prefix)
|
||||
if http_path.include?("://") || !%w(.css .png .jpg .js .gif).include?(File.extname(http_path))
|
||||
http_path
|
||||
else
|
||||
real_path = File.join(self.environment == "build" ? self.build_dir : self.public, prefix, path)
|
||||
http_path << "?" + File.mtime(real_path).strftime("%s") if File.readable?(real_path)
|
||||
http_path
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue