mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
🎨 create assetHash if not available in asset_url helper
refs #6982 - was before generated in ConfigManager [ci skip]
This commit is contained in:
parent
66dbd5f5f2
commit
f4bee50e86
1 changed files with 6 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
var config = require('../../config'),
|
||||
utils = require('../../utils');
|
||||
utils = require('../../utils'),
|
||||
crypto = require('crypto');
|
||||
|
||||
function getAssetUrl(path, isAdmin, minify) {
|
||||
var output = '';
|
||||
|
@ -25,6 +26,10 @@ function getAssetUrl(path, isAdmin, minify) {
|
|||
output += path;
|
||||
|
||||
if (!path.match(/^favicon\.ico$/)) {
|
||||
if (!config.get('assetHash')) {
|
||||
config.set('assetHash', (crypto.createHash('md5').update(config.get('ghostVersion') + Date.now()).digest('hex')).substring(0, 10));
|
||||
}
|
||||
|
||||
output = output + '?v=' + config.get('assetHash');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue