mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-01 13:53:09 +08:00
Started work on subdirectory support
This commit is contained in:
@ -20,11 +20,11 @@ if (!function_exists('versioned_asset')) {
|
||||
}
|
||||
|
||||
if (isset($manifest[$file])) {
|
||||
return '/' . $manifest[$file];
|
||||
return baseUrl($manifest[$file]);
|
||||
}
|
||||
|
||||
if (file_exists(public_path($file))) {
|
||||
return '/' . $file;
|
||||
return baseUrl($file);
|
||||
}
|
||||
|
||||
throw new InvalidArgumentException("File {$file} not defined in asset manifest.");
|
||||
@ -62,6 +62,17 @@ function setting($key, $default = false)
|
||||
return $settingService->get($key, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to create url's relative to the applications root path.
|
||||
* @param $path
|
||||
* @return string
|
||||
*/
|
||||
function baseUrl($path)
|
||||
{
|
||||
$path = trim($path, '/');
|
||||
return rtrim(config('app.url'), '/') . '/' . $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a url with multiple parameters for sorting purposes.
|
||||
* Works out the logic to set the correct sorting direction
|
||||
|
Reference in New Issue
Block a user