mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-04 14:50:47 +01:00
fixed #4624
This commit is contained in:
@@ -45,28 +45,11 @@ sitemap.render = function(callback) {
|
||||
});
|
||||
};
|
||||
|
||||
sitemap.getStaticUrls = function(callback) {
|
||||
callback(null, [{
|
||||
url: '',
|
||||
changefreq: 'weekly',
|
||||
priority: '0.6'
|
||||
}, {
|
||||
url: '/recent',
|
||||
changefreq: 'daily',
|
||||
priority: '0.4'
|
||||
}, {
|
||||
url: '/users',
|
||||
changefreq: 'daily',
|
||||
priority: '0.4'
|
||||
}, {
|
||||
url: '/groups',
|
||||
changefreq: 'daily',
|
||||
priority: '0.4'
|
||||
}]);
|
||||
};
|
||||
|
||||
sitemap.getPages = function(callback) {
|
||||
if (sitemap.maps.pages && sitemap.maps.pages.cache.length) {
|
||||
if (
|
||||
sitemap.maps.pages &&
|
||||
Date.now() < parseInt(sitemap.maps.pages.cacheSetTimestamp, 10) + parseInt(sitemap.maps.pages.cacheResetPeriod, 10)
|
||||
) {
|
||||
return sitemap.maps.pages.toXML(callback);
|
||||
}
|
||||
|
||||
@@ -98,7 +81,10 @@ sitemap.getPages = function(callback) {
|
||||
};
|
||||
|
||||
sitemap.getCategories = function(callback) {
|
||||
if (sitemap.maps.categories && sitemap.maps.categories.cache.length) {
|
||||
if (
|
||||
sitemap.maps.categories &&
|
||||
Date.now() < parseInt(sitemap.maps.categories.cacheSetTimestamp, 10) + parseInt(sitemap.maps.categories.cacheResetPeriod, 10)
|
||||
) {
|
||||
return sitemap.maps.categories.toXML(callback);
|
||||
}
|
||||
|
||||
@@ -137,7 +123,10 @@ sitemap.getTopicPage = function(page, callback) {
|
||||
var min = (parseInt(page, 10) - 1) * numTopics;
|
||||
var max = min + numTopics;
|
||||
|
||||
if (sitemap.maps.topics[page-1] && sitemap.maps.topics[page-1].cache.length) {
|
||||
if (
|
||||
sitemap.maps.topics[page-1] &&
|
||||
Date.now() < parseInt(sitemap.maps.topics[page-1].cacheSetTimestamp, 10) + parseInt(sitemap.maps.topics[page-1].cacheResetPeriod, 10)
|
||||
) {
|
||||
return sitemap.maps.topics[page-1].toXML(callback);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user