2020-12-08 23:24:36 +00:00
|
|
|
import { productName, productSlug } from 'data/metadata'
|
|
|
|
import DocsPage from '@hashicorp/react-docs-page'
|
2021-04-07 19:50:38 +00:00
|
|
|
// Imports below are only used server-side
|
2022-01-13 21:10:33 +00:00
|
|
|
import { getStaticGenerationFunctions } from '@hashicorp/react-docs-page/server'
|
2020-12-08 23:24:36 +00:00
|
|
|
|
2021-04-07 19:50:38 +00:00
|
|
|
// Configure the docs path
|
|
|
|
const baseRoute = 'api-docs'
|
|
|
|
const navDataFile = `data/${baseRoute}-nav-data.json`
|
|
|
|
const localContentDir = `content/${baseRoute}`
|
|
|
|
const product = { name: productName, slug: productSlug }
|
2020-12-08 23:24:36 +00:00
|
|
|
|
|
|
|
export default function ApiDocsLayout(props) {
|
|
|
|
return (
|
2021-04-07 19:50:38 +00:00
|
|
|
<DocsPage baseRoute={baseRoute} product={product} staticProps={props} />
|
2020-12-08 23:24:36 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-01-13 21:10:33 +00:00
|
|
|
const { getStaticPaths, getStaticProps } = getStaticGenerationFunctions(
|
|
|
|
process.env.ENABLE_VERSIONED_DOCS === 'true'
|
|
|
|
? {
|
|
|
|
strategy: 'remote',
|
|
|
|
basePath: baseRoute,
|
|
|
|
fallback: 'blocking',
|
|
|
|
revalidate: 360, // 1 hour
|
|
|
|
product: productSlug,
|
|
|
|
}
|
|
|
|
: {
|
|
|
|
strategy: 'fs',
|
|
|
|
localContentDir: localContentDir,
|
|
|
|
navDataFile: navDataFile,
|
|
|
|
product: productSlug,
|
|
|
|
}
|
|
|
|
)
|
2020-12-08 23:24:36 +00:00
|
|
|
|
2022-01-13 21:10:33 +00:00
|
|
|
export { getStaticPaths, getStaticProps }
|