|
|
@ -44,36 +44,43 @@ var express = require('express'),
|
|
|
|
* accepts: metaTags
|
|
|
|
* accepts: metaTags
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
app.build_header = function (options, callback) {
|
|
|
|
app.build_header = function (options, callback) {
|
|
|
|
var defaultMetaTags = [{
|
|
|
|
var custom_header = {
|
|
|
|
name: 'viewport',
|
|
|
|
'navigation': []
|
|
|
|
content: 'width=device-width, initial-scale=1.0, user-scalable=no'
|
|
|
|
};
|
|
|
|
}, {
|
|
|
|
|
|
|
|
name: 'content-type',
|
|
|
|
plugins.fireHook('filter:header.build', custom_header, function(err, custom_header) {
|
|
|
|
content: 'text/html; charset=UTF-8'
|
|
|
|
var defaultMetaTags = [{
|
|
|
|
}, {
|
|
|
|
name: 'viewport',
|
|
|
|
name: 'apple-mobile-web-app-capable',
|
|
|
|
content: 'width=device-width, initial-scale=1.0, user-scalable=no'
|
|
|
|
content: 'yes'
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
name: 'content-type',
|
|
|
|
property: 'og:site_name',
|
|
|
|
content: 'text/html; charset=UTF-8'
|
|
|
|
content: meta.config.title || 'NodeBB'
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
name: 'apple-mobile-web-app-capable',
|
|
|
|
property: 'keywords',
|
|
|
|
content: 'yes'
|
|
|
|
content: meta.config['keywords'] || ''
|
|
|
|
}, {
|
|
|
|
}],
|
|
|
|
property: 'og:site_name',
|
|
|
|
metaString = utils.buildMetaTags(defaultMetaTags.concat(options.metaTags || [])),
|
|
|
|
content: meta.config.title || 'NodeBB'
|
|
|
|
templateValues = {
|
|
|
|
}, {
|
|
|
|
cssSrc: meta.config['theme:src'] || nconf.get('relative_path') + '/vendor/bootstrap/css/bootstrap.min.css',
|
|
|
|
property: 'keywords',
|
|
|
|
pluginCSS: plugins.cssFiles.map(function(file) { return { path: file } }),
|
|
|
|
content: meta.config['keywords'] || ''
|
|
|
|
title: meta.config.title || 'NodeBB',
|
|
|
|
}],
|
|
|
|
browserTitle: meta.config.title || 'NodeBB',
|
|
|
|
metaString = utils.buildMetaTags(defaultMetaTags.concat(options.metaTags || [])),
|
|
|
|
csrf: options.res.locals.csrf_token,
|
|
|
|
templateValues = {
|
|
|
|
relative_path: nconf.get('relative_path'),
|
|
|
|
cssSrc: meta.config['theme:src'] || nconf.get('relative_path') + '/vendor/bootstrap/css/bootstrap.min.css',
|
|
|
|
meta_tags: metaString,
|
|
|
|
pluginCSS: plugins.cssFiles.map(function(file) { return { path: file } }),
|
|
|
|
clientScripts: clientScripts
|
|
|
|
title: meta.config.title || 'NodeBB',
|
|
|
|
};
|
|
|
|
browserTitle: meta.config.title || 'NodeBB',
|
|
|
|
|
|
|
|
csrf: options.res.locals.csrf_token,
|
|
|
|
translator.translate(templates.header.parse(templateValues), function(template) {
|
|
|
|
relative_path: nconf.get('relative_path'),
|
|
|
|
callback(null, template);
|
|
|
|
meta_tags: metaString,
|
|
|
|
|
|
|
|
clientScripts: clientScripts,
|
|
|
|
|
|
|
|
navigation: custom_header.navigation
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
translator.translate(templates.header.parse(templateValues), function(template) {
|
|
|
|
|
|
|
|
callback(null, template);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|