fix: getStaticPaths() slug for ref docs

This commit is contained in:
Greg Richardson
2023-05-10 10:39:52 -06:00
parent 413b4b6a79
commit a2e2cc558f
26 changed files with 27 additions and 31 deletions

View File

@@ -1,14 +1,11 @@
import { ICommonSection } from '~/components/reference/Reference.types'
async function handleRefGetStaticPaths(sections: ICommonSection[], libraryPath: string) {
async function handleRefGetStaticPaths(sections: ICommonSection[]) {
return {
paths: sections.map((section) => {
return {
params: {
slug: libraryPath
.split('/')
.filter((dir) => !!dir)
.concat(section.slug),
slug: [section.slug],
},
}
}),

View File

@@ -20,5 +20,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -19,5 +19,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -17,5 +17,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -40,5 +40,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -17,5 +17,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -39,5 +39,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -17,5 +17,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -40,5 +40,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -17,5 +17,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -39,5 +39,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -1,4 +1,3 @@
import { inspect } from 'util'
import clientLibsCommonSections from '~/../../spec/common-client-libs-sections.json'
import typeSpec from '~/../../spec/enrichments/tsdoc_v2/combined.json'
import spec from '~/../../spec/supabase_js_v2.yml' assert { type: 'yml' }
@@ -27,5 +26,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -40,5 +40,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -27,5 +27,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -40,5 +40,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -26,5 +26,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -40,5 +40,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -21,5 +21,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -21,5 +21,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -18,5 +18,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -17,5 +17,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -21,5 +21,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -17,5 +17,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -40,5 +40,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -17,5 +17,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}

View File

@@ -39,5 +39,5 @@ export async function getStaticProps() {
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections, libraryPath)
return handleRefGetStaticPaths(sections)
}