Merge branch 'master' of github.com:designcreateplay/NodeBB

v1.18.x
Julian Lam 11 years ago
commit f807df84d8

@ -59,9 +59,11 @@
<li class="visible-xs"> <li class="visible-xs">
<a href="/search">[[global:header.search]]</a> <a href="/search">[[global:header.search]]</a>
</li> </li>
<li> <!-- BEGIN navigation -->
<a href="/"></a> <li class="{navigation.class}">
<a href="{navigation.route}">{navigation.text}</a>
</li> </li>
<!-- END navigation -->
</ul> </ul>
<form id="search-form" class="navbar-form navbar-right hidden-xs" role="search" method="GET" action=""> <form id="search-form" class="navbar-form navbar-right hidden-xs" role="search" method="GET" action="">

@ -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);
});
}); });
}; };

Loading…
Cancel
Save