FEATURE: add clean support for running Discourse in a subfolder

To setup set DISCOURSE_RELATIVE_URL_ROOT to the folder you wish
This commit is contained in:
Sam
2015-03-09 11:45:36 +11:00
parent 4c4183228f
commit f5af4768eb
27 changed files with 81 additions and 34 deletions

View File

@ -114,12 +114,16 @@ class DiscourseStylesheets
"#{GlobalSetting.cdn_url}#{stylesheet_relpath}?__ws=#{Discourse.current_hostname}"
end
def root_path
"#{GlobalSetting.relative_url_root}/"
end
def stylesheet_relpath
"/#{CACHE_PATH}/#{stylesheet_filename}"
"#{root_path}#{CACHE_PATH}/#{stylesheet_filename}"
end
def stylesheet_relpath_no_digest
"/#{CACHE_PATH}/#{stylesheet_filename_no_digest}"
"#{root_path}#{CACHE_PATH}/#{stylesheet_filename_no_digest}"
end
def stylesheet_filename