v1.18.x
Barış Soner Uşaklı 7 years ago
parent f225aa25de
commit fe3a75812f

@ -13,9 +13,6 @@ categoriesController.list = function (req, res, next) {
res.locals.metaTags = [{
name: 'title',
content: String(meta.config.title || 'NodeBB'),
}, {
property: 'og:title',
content: '[[pages:categories]]',
}, {
property: 'og:type',
content: 'website',
@ -42,6 +39,10 @@ categoriesController.list = function (req, res, next) {
if (req.originalUrl.startsWith(nconf.get('relative_path') + '/api/categories') || req.originalUrl.startsWith(nconf.get('relative_path') + '/categories')) {
data.breadcrumbs = helpers.buildBreadcrumbs([{ text: data.title }]);
res.locals.metaTags.push({
property: 'og:title',
content: '[[pages:categories]]',
});
}
data.categories.forEach(function (category) {

@ -124,7 +124,7 @@ Tags.parse = function (req, data, meta, link, callback) {
addIfNotExists(meta, 'property', 'og:title', Meta.config.title || 'NodeBB');
var ogUrl = nconf.get('url') + req.path;
var ogUrl = nconf.get('url') + (req.originalUrl !== '/' ? req.originalUrl : '');
addIfNotExists(meta, 'property', 'og:url', ogUrl);
addIfNotExists(meta, 'name', 'description', Meta.config.description);

Loading…
Cancel
Save