Skip to content

Node.js based forum software built for the modern web

if route is home display home as title

Barış Soner Uşaklıc406d26beb3a
diff --git a/src/controllers/categories.js b/src/controllers/categories.js
index 25461205bc..67f693249a 100644
--- a/src/controllers/categories.js
+++ b/src/controllers/categories.js
@@ -33,11 +33,12 @@ categoriesController.list = function (req, res, next) {
},
function () {
var data = {
- title: '[[pages:categories]]',
+ title: '[[pages:home]]',
categories: categoryData,
};
if (req.originalUrl.startsWith(nconf.get('relative_path') + '/api/categories') || req.originalUrl.startsWith(nconf.get('relative_path') + '/categories')) {
+ data.title = '[[pages:categories]]';
data.breadcrumbs = helpers.buildBreadcrumbs([{ text: data.title }]);
res.locals.metaTags.push({
property: 'og:title',
diff --git a/src/controllers/popular.js b/src/controllers/popular.js
index 8b0ee26899..734268cefd 100644
--- a/src/controllers/popular.js
+++ b/src/controllers/popular.js
@@ -45,14 +45,15 @@ popularController.get = function (req, res, next) {
},
function (topics) {
var data = {
+ title: '[[pages:home]]',
topics: topics,
'feeds:disableRSS': parseInt(meta.config['feeds:disableRSS'], 10) === 1,
rssFeedUrl: nconf.get('relative_path') + '/popular/' + (req.params.term || 'daily') + '.rss',
- title: '[[pages:popular-' + term + ']]',
term: term,
};
if (req.originalUrl.startsWith(nconf.get('relative_path') + '/api/popular') || req.originalUrl.startsWith(nconf.get('relative_path') + '/popular')) {
+ data.title = '[[pages:popular-' + term + ']]';
var breadcrumbs = [{ text: termToBreadcrumb[term] }];
if (req.params.term) {
diff --git a/src/controllers/recent.js b/src/controllers/recent.js
index 1477cf01f9..473252e6c0 100644
--- a/src/controllers/recent.js
+++ b/src/controllers/recent.js
@@ -61,7 +61,7 @@ recentController.get = function (req, res, next) {
if (req.uid) {
data.rssFeedUrl += '?uid=' + req.uid + '&token=' + rssToken;
}
- data.title = '[[pages:recent]]';
+ data.title = '[[pages:home]]';
data.filters = helpers.buildFilters('recent', filter);
data.selectedFilter = data.filters.find(function (filter) {
@@ -72,6 +72,7 @@ recentController.get = function (req, res, next) {
data.pagination = pagination.create(page, pageCount, req.query);
if (req.originalUrl.startsWith(nconf.get('relative_path') + '/api/recent') || req.originalUrl.startsWith(nconf.get('relative_path') + '/recent')) {
+ data.title = '[[pages:recent]]';
data.breadcrumbs = helpers.buildBreadcrumbs([{ text: '[[recent:title]]' }]);
}
diff --git a/src/controllers/unread.js b/src/controllers/unread.js
index 6d60bab8e7..d50b59945b 100644
--- a/src/controllers/unread.js
+++ b/src/controllers/unread.js
@@ -54,6 +54,7 @@ unreadController.get = function (req, res, next) {
}, next);
},
function (data) {
+ data.title = '[[pages:home]]';
data.pageCount = Math.max(1, Math.ceil(data.topicCount / settings.topicsPerPage));
data.pagination = pagination.create(page, data.pageCount, req.query);
@@ -66,10 +67,10 @@ unreadController.get = function (req, res, next) {
data.selectedCategory = results.watchedCategories.selectedCategory;
data.selectedCids = results.watchedCategories.selectedCids;
if (req.originalUrl.startsWith(nconf.get('relative_path') + '/api/unread') || req.originalUrl.startsWith(nconf.get('relative_path') + '/unread')) {
+ data.title = '[[pages:unread]]';
data.breadcrumbs = helpers.buildBreadcrumbs([{ text: '[[unread:title]]' }]);
}
- data.title = '[[pages:unread]]';
data.filters = helpers.buildFilters('unread', filter);
data.selectedFilter = data.filters.find(function (filter) {