mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 23:15:48 +01:00
fixing link tags; misc bug fixes
This commit is contained in:
@@ -162,7 +162,7 @@ middleware.renderHeader = function(req, res, callback) {
|
|||||||
description: meta.config.description || '',
|
description: meta.config.description || '',
|
||||||
'brand:logo': meta.config['brand:logo'] || '',
|
'brand:logo': meta.config['brand:logo'] || '',
|
||||||
'brand:logo:display': meta.config['brand:logo']?'':'hide',
|
'brand:logo:display': meta.config['brand:logo']?'':'hide',
|
||||||
csrf: options.res.locals.csrf_token,
|
csrf: res.locals.csrf_token,
|
||||||
relative_path: nconf.get('relative_path'),
|
relative_path: nconf.get('relative_path'),
|
||||||
clientScripts: clientScripts,
|
clientScripts: clientScripts,
|
||||||
navigation: custom_header.navigation,
|
navigation: custom_header.navigation,
|
||||||
@@ -178,15 +178,15 @@ middleware.renderHeader = function(req, res, callback) {
|
|||||||
'"': '"'
|
'"': '"'
|
||||||
};
|
};
|
||||||
|
|
||||||
for (var key in options.res.locals.config) {
|
for (var key in res.locals.config) {
|
||||||
if (options.res.locals.config.hasOwnProperty(key)) {
|
if (res.locals.config.hasOwnProperty(key)) {
|
||||||
templateValues[key] = options.res.locals.config[key];
|
templateValues[key] = res.locals.config[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var uid = '0';
|
var uid = '0';
|
||||||
|
|
||||||
templateValues.metaTags = defaultMetaTags.concat(options.res.locals.metaTags || []).map(function(tag) {
|
templateValues.metaTags = defaultMetaTags.concat(res.locals.metaTags || []).map(function(tag) {
|
||||||
if(!tag || typeof tag.content !== 'string') {
|
if(!tag || typeof tag.content !== 'string') {
|
||||||
winston.warn('Invalid meta tag. ', tag);
|
winston.warn('Invalid meta tag. ', tag);
|
||||||
return tag;
|
return tag;
|
||||||
@@ -198,15 +198,15 @@ middleware.renderHeader = function(req, res, callback) {
|
|||||||
return tag;
|
return tag;
|
||||||
});
|
});
|
||||||
|
|
||||||
templateValues.linkTags = defaultLinkTags.concat(options.linkTags || []);
|
templateValues.linkTags = defaultLinkTags.concat(res.locals.linkTags || []);
|
||||||
templateValues.linkTags.push({
|
templateValues.linkTags.push({
|
||||||
rel: "icon",
|
rel: "icon",
|
||||||
type: "image/x-icon",
|
type: "image/x-icon",
|
||||||
href: nconf.get('relative_path') + '/favicon.ico'
|
href: nconf.get('relative_path') + '/favicon.ico'
|
||||||
});
|
});
|
||||||
|
|
||||||
if(options.req.user && options.req.user.uid) {
|
if(req.user && req.user.uid) {
|
||||||
uid = options.req.user.uid;
|
uid = req.user.uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
templateValues.useCustomCSS = false;
|
templateValues.useCustomCSS = false;
|
||||||
@@ -217,7 +217,7 @@ middleware.renderHeader = function(req, res, callback) {
|
|||||||
|
|
||||||
async.parallel([
|
async.parallel([
|
||||||
function(next) {
|
function(next) {
|
||||||
translator.get('pages:' + path.basename(options.req.url), function(translated) {
|
translator.get('pages:' + path.basename(req.url), function(translated) {
|
||||||
var metaTitle = templateValues.metaTags.filter(function(tag) {
|
var metaTitle = templateValues.metaTags.filter(function(tag) {
|
||||||
return tag.name === 'title';
|
return tag.name === 'title';
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user