File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { type GetStaticProps } from 'next'
22
33import { NotionPage } from '@/components/NotionPage'
4- import { domain , isDev } from '@/lib/config'
4+ import { domain , isDev , pageUrlOverrides } from '@/lib/config'
55import { getSiteMap } from '@/lib/get-site-map'
66import { resolveNotionPage } from '@/lib/resolve-notion-page'
77import { type PageProps , type Params } from '@/lib/types'
@@ -34,13 +34,17 @@ export async function getStaticPaths() {
3434
3535 const siteMap = await getSiteMap ( )
3636
37+ // Combine sitemap paths with URL overrides (e.g., /articles, /notes)
38+ // URL overrides might not be in the sitemap if not directly linked from root
39+ const allPageIds = [
40+ ...new Set ( [
41+ ...Object . keys ( siteMap . canonicalPageMap ) ,
42+ ...Object . keys ( pageUrlOverrides )
43+ ] )
44+ ]
45+
3746 const staticPaths = {
38- paths : Object . keys ( siteMap . canonicalPageMap ) . map ( ( pageId ) => ( {
39- params : {
40- pageId
41- }
42- } ) ) ,
43- // paths: [],
47+ paths : allPageIds . map ( ( pageId ) => ( { params : { pageId } } ) ) ,
4448 fallback : true
4549 }
4650
You can’t perform that action at this time.
0 commit comments