mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 09:52:06 +03:00
960993b257
refs #9589 * update asset helper to use newer code standards * update authors helper to use newer code standards
17 lines
421 B
JavaScript
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)
|
|
);
|
|
};
|