diff --git a/public/src/utils.js b/public/src/utils.js index 988253f3c1..dd7985a2a8 100644 --- a/public/src/utils.js +++ b/public/src/utils.js @@ -153,43 +153,6 @@ } return result; }, - buildMetaTags: function(tagsArr) { - var tags = '', - tag; - for (var x = 0, numTags = tagsArr.length; x < numTags; x++) { - if (tags.length > 0) { - tags += "\n\t"; - } - tag = ' 0) tags += "\n\t"; - tag = ' {browserTitle} - {meta_tags} - + + name="{metaTags.name}" property="{metaTags.property}" content="{metaTags.content}" /> + - {link_tags} + + link="{linkTags.link}" rel="{linkTags.rel}" href="{linkTags.href}" /> + diff --git a/src/meta.js b/src/meta.js index 1edd2dc8ab..23da3db2a3 100644 --- a/src/meta.js +++ b/src/meta.js @@ -287,21 +287,16 @@ var fs = require('fs'), }, function (err, results) { if (results.minFile > results.mtime) { winston.info('No changes to client-side libraries -- skipping minification'); - callback(null, [path.relative(path.join(__dirname, '../public'), Meta.js.minFile) + (meta.config['cache-buster'] ? '?v=' + meta.config['cache-buster'] : '')]); + callback(null, [path.relative(path.join(__dirname, '../public'), Meta.js.minFile)]); } else { Meta.js.minify(function () { callback(null, [ - path.relative(path.join(__dirname, '../public'), Meta.js.minFile) + (meta.config['cache-buster'] ? '?v=' + meta.config['cache-buster'] : '') + path.relative(path.join(__dirname, '../public'), Meta.js.minFile) ]); }); } }); } else { - if (meta.config['cache-buster']) { - scripts = scripts.map(function(script) { - return script + '?v=' + meta.config['cache-buster']; - }); - } callback(null, scripts); } }); diff --git a/src/webserver.js b/src/webserver.js index 114faed8ff..9f96ba3b3b 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -94,13 +94,11 @@ module.exports.server = server; }], templateValues = { bootswatchCSS: meta.config['theme:src'], - pluginCSS: plugins.cssFiles.map(function(file) { return { path: nconf.get('relative_path') + file.replace(/\\/g, '/') + (meta.config['cache-buster'] ? '?v=' + meta.config['cache-buster'] : '') }; }), + pluginCSS: plugins.cssFiles.map(function(file) { return { path: nconf.get('relative_path') + file.replace(/\\/g, '/') }; }), title: meta.config.title || '', description: meta.config.description || '', 'brand:logo': meta.config['brand:logo'] || '', 'brand:logo:display': meta.config['brand:logo']?'':'hide', - 'brand:favicon': meta.config['brand:favicon'] || nconf.get('relative_path') + '/favicon.ico', - browserTitle: meta.config.browserTitle || 'NodeBB', csrf: options.res.locals.csrf_token, relative_path: nconf.get('relative_path'), clientScripts: clientScripts, @@ -119,13 +117,20 @@ module.exports.server = server; var uid = '0'; // Meta Tags - templateValues.meta_tags = utils.buildMetaTags(defaultMetaTags.concat(options.metaTags || []).map(function(tag) { + templateValues.metaTags = defaultMetaTags.concat(options.metaTags || []).map(function(tag) { tag.content = tag.content.replace(/[&<>'"]/g, function(tag) { return escapeList[tag] || tag; }); return tag; - })); - templateValues.link_tags = utils.buildLinkTags(defaultLinkTags.concat(options.linkTags || [])); + }); + + // Link Tags + templateValues.linkTags = defaultLinkTags.concat(options.linkTags || []); + templateValues.linkTags.push({ + rel: "icon", + type: "image/x-icon", + href: meta.config['brand:favicon'] || nconf.get('relative_path') + '/favicon.ico' + }); if(options.req.user && options.req.user.uid) { uid = options.req.user.uid;