mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 10:46:14 +01:00
if route is home display home as title
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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]]' }]);
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user