diff --git a/src/controllers/categories.js b/src/controllers/categories.js index d5cd04b504..29ad406f98 100644 --- a/src/controllers/categories.js +++ b/src/controllers/categories.js @@ -13,9 +13,6 @@ categoriesController.list = function (req, res, next) { res.locals.metaTags = [{ name: 'title', content: String(meta.config.title || 'NodeBB'), - }, { - name: 'description', - content: String(meta.config.description || ''), }, { property: 'og:title', content: '[[pages:categories]]', @@ -24,6 +21,13 @@ categoriesController.list = function (req, res, next) { content: 'website', }]; + if (meta.config.description) { + res.locals.metaTags.push({ + name: 'description', + content: String(meta.config.description || ''), + }); + } + var ogImage = meta.config['og:image'] || meta.config['brand:logo'] || ''; if (ogImage) { if (!ogImage.startsWith('http')) { diff --git a/src/meta/tags.js b/src/meta/tags.js index 56269633ae..afef4bab0f 100644 --- a/src/meta/tags.js +++ b/src/meta/tags.js @@ -131,7 +131,7 @@ module.exports = function (Meta) { } }); - if (!hasDescription) { + if (!hasDescription && Meta.config.description) { meta.push({ name: 'description', content: validator.escape(String(Meta.config.description || '')),