fix: getStaticPaths() slug for ref docs
This commit is contained in:
@@ -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],
|
||||
},
|
||||
}
|
||||
}),
|
||||
|
||||
@@ -20,5 +20,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -19,5 +19,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -40,5 +40,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -39,5 +39,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -40,5 +40,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -39,5 +39,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -40,5 +40,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -27,5 +27,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -40,5 +40,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -26,5 +26,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -40,5 +40,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -21,5 +21,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -21,5 +21,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -18,5 +18,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -21,5 +21,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -40,5 +40,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
@@ -39,5 +39,5 @@ export async function getStaticProps() {
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return handleRefGetStaticPaths(sections, libraryPath)
|
||||
return handleRefGetStaticPaths(sections)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user