mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
parent
19bdb64efc
commit
2124e95e54
2 changed files with 6 additions and 4 deletions
|
@ -1,9 +1,9 @@
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
// Handlebars Helper {{gh-path}}
|
// Handlebars Helper {{gh-path}}
|
||||||
// Usage: Assume 'http://www.myghostblog.org/myblog/'
|
// Usage: Assume 'http://www.myghostblog.org/myblog/'
|
||||||
// {{gh-path}} or {{gh-path ‘blog’}} for Ghost’s root (/myblog/)
|
// {{gh-path}} or {{gh-path 'blog'}} for Ghost's root (/myblog/)
|
||||||
// {{gh-path ‘admin’}} for Ghost’s admin root (/myblog/ghost/)
|
// {{gh-path 'admin'}} for Ghost's admin root (/myblog/ghost/)
|
||||||
// {{gh-path ‘api’}} for Ghost’s api root (/myblog/ghost/api/v0.1/)
|
// {{gh-path 'api'}} for Ghost's api root (/myblog/ghost/api/v0.1/)
|
||||||
// {{gh-path 'admin' '/assets/hi.png'}} for resolved url (/myblog/ghost/assets/hi.png)
|
// {{gh-path 'admin' '/assets/hi.png'}} for resolved url (/myblog/ghost/assets/hi.png)
|
||||||
import ghostPaths from 'ghost/utils/ghost-paths';
|
import ghostPaths from 'ghost/utils/ghost-paths';
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,9 @@ var makeRoute = function (root, args) {
|
||||||
parts = Array.prototype.slice.call(args, 0);
|
parts = Array.prototype.slice.call(args, 0);
|
||||||
|
|
||||||
parts.forEach(function (part) {
|
parts.forEach(function (part) {
|
||||||
|
if (part) {
|
||||||
route = [route, part.replace(slashAtStart, '').replace(slashAtEnd, '')].join('/');
|
route = [route, part.replace(slashAtStart, '').replace(slashAtEnd, '')].join('/');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return route += '/';
|
return route += '/';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue