fix generate sitemap

This commit is contained in:
mvozbranyuk committed 2023-05-15 18:31:23 +03:00
1 parent 7ec0744f00
commit f115f268ce
2 files changed
+5 -7

No files matched your search

+3 -5
View File
@@ -24,7 +24,8 @@ async function generate() {
'!pages/*/index.tsx',
'!pages/api',
'!pages/404.js',
'.next/server/pages/partners/*.html',
'.next/server/pages/partners/integrations/*.html',
'.next/server/pages/partners/experts/*.html',
])
const blogUrl = 'blog'
@@ -38,8 +39,7 @@ async function generate() {
.filter((page) => !page.includes('_document.tsx'))
.map((page) => {
const path = page
//replace the path for the generated partner pages
.replace('.next/server/pages/partners/', '/partners/')
.replace('.next/server/pages', '')
.replace('pages', '')
.replace('.html', '')
// add a `/` for blog posts
@@ -49,8 +49,6 @@ async function generate() {
.replace('_alternatives', '/alternatives')
.replace('.tsx', '')
.replace('.mdx', '')
// replace the path for the generated partner pages
.replace('.next/server/pages/partners/', '/partners/')
// replace the paths for nested 'index' based routes
.replace('/auth/Auth', '/auth')
.replace('/database/Database', '/database')
+2 -2
View File
@@ -37,8 +37,8 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
.eq('approved', true)
.eq('slug', params!.slug as string)
.single()
if (!partner) {
if (!partner || process.env.npm_lifecycle_event === 'build') {
return {
notFound: true,
}