mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
18 lines
306 B
Ruby
18 lines
306 B
Ruby
module GlobalPath
|
|
def path(p)
|
|
"#{GlobalSetting.relative_url_root}#{p}"
|
|
end
|
|
|
|
def cdn_path(p)
|
|
"#{GlobalSetting.cdn_url}#{path(p)}"
|
|
end
|
|
|
|
def cdn_relative_path(path)
|
|
if (cdn_url = GlobalSetting.cdn_url).present?
|
|
URI.parse(cdn_url).path + path
|
|
else
|
|
path
|
|
end
|
|
end
|
|
|
|
end
|