Ghost/core/server/helpers/asset.js
Vikas Potluri 960993b257 Migrated asset and author helpers to es6 (#10611)
refs #9589

* update asset helper to use newer code standards

* update authors helper to use newer code standards
2019-03-26 10:06:41 +05:30

17 lines
421 B
JavaScript

// # Asset helper
// Usage: `{{asset "css/screen.css"}}`
//
// Returns the path to the specified asset.
const proxy = require('./proxy');
const get = require('lodash/get');
const {SafeString} = proxy;
const {getAssetUrl} = proxy.metaData;
module.exports = function asset(path, options) {
const hasMinFile = get(options, 'hash.hasMinFile');
return new SafeString(
getAssetUrl(path, hasMinFile)
);
};