fixes sitemap base url issue when using with subfolder (#8247)

* fixes sitemap base url issue when using with subfolder

* fixes sitemap base url issue when using with subfolder

* uses directly relative path

* removes prefix variable
v1.18.x
hb90dev 5 years ago committed by GitHub
parent d77036dbd1
commit 3ce885fff2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -41,15 +41,15 @@ sitemap.getPages = async function () {
changefreq: 'weekly', changefreq: 'weekly',
priority: 0.6, priority: 0.6,
}, { }, {
url: '/recent', url: `${nconf.get('relative_path')}/recent`,
changefreq: 'daily', changefreq: 'daily',
priority: 0.4, priority: 0.4,
}, { }, {
url: '/users', url: `${nconf.get('relative_path')}/users`,
changefreq: 'daily', changefreq: 'daily',
priority: 0.4, priority: 0.4,
}, { }, {
url: '/groups', url: `${nconf.get('relative_path')}/groups`,
changefreq: 'daily', changefreq: 'daily',
priority: 0.4, priority: 0.4,
}]; }];
@ -75,7 +75,7 @@ sitemap.getCategories = async function () {
categoriesData.forEach(function (category) { categoriesData.forEach(function (category) {
if (category) { if (category) {
categoryUrls.push({ categoryUrls.push({
url: '/category/' + category.slug, url: `${nconf.get('relative_path')}/category/` + category.slug,
changefreq: 'weekly', changefreq: 'weekly',
priority: 0.4, priority: 0.4,
}); });
@ -112,7 +112,7 @@ sitemap.getTopicPage = async function (page) {
topicData.forEach(function (topic) { topicData.forEach(function (topic) {
if (topic) { if (topic) {
topicUrls.push({ topicUrls.push({
url: '/topic/' + topic.slug, url: `${nconf.get('relative_path')}/topic/` + topic.slug,
lastmodISO: utils.toISOString(topic.lastposttime), lastmodISO: utils.toISOString(topic.lastposttime),
changefreq: 'daily', changefreq: 'daily',
priority: 0.6, priority: 0.6,

Loading…
Cancel
Save