mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-29 15:10:06 +00:00
fix(sitemap多了个斜杠导致Google Search Console无法自动编入索引)
This commit is contained in:
@@ -38,6 +38,11 @@ export const getServerSideProps = async ctx => {
|
||||
}
|
||||
|
||||
function generateLocalesSitemap(link, allPages, locale) {
|
||||
// 确保链接不以斜杠结尾
|
||||
if (link && link.endsWith('/')) {
|
||||
link = link.slice(0, -1)
|
||||
}
|
||||
|
||||
if (locale && locale.length > 0 && locale.indexOf('/') !== 0) {
|
||||
locale = '/' + locale
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user