df7e64fafa
refs #10790 - Moved /core/apps into core/frontend - Moved /core/server/helpers to /core/frontend/helpers along with /core/server/services/themes - Changed helper location in overrides - Moved /core/server/services/routing to /core/frontend/services - Moved /core/server/services/url to /core/frontend/services - Moved /core/server/data/meta to /core/frontend/meta - Moved /core/server/services/rss to /core/frontend/services - Moved /core/server/data/xml to /core/frontend/services
19 lines
627 B
JavaScript
19 lines
627 B
JavaScript
// # URL helper
|
|
// Usage: `{{url}}`, `{{url absolute="true"}}`
|
|
//
|
|
// Returns the URL for the current object scope i.e. If inside a post scope will return post permalink
|
|
// `absolute` flag outputs absolute URL, else URL is relative
|
|
|
|
var proxy = require('./proxy'),
|
|
SafeString = proxy.SafeString,
|
|
getMetaDataUrl = proxy.metaData.getMetaDataUrl;
|
|
|
|
module.exports = function url(options) {
|
|
var absolute = options && options.hash.absolute && options.hash.absolute !== 'false',
|
|
outputUrl = getMetaDataUrl(this, absolute);
|
|
|
|
outputUrl = encodeURI(decodeURI(outputUrl));
|
|
|
|
return new SafeString(outputUrl);
|
|
};
|