open-nomad/website/pages/intro/[[...page]].jsx

38 lines
1 KiB
React
Raw Normal View History

2020-12-07 22:04:11 +00:00
import { productName, productSlug } from 'data/metadata'
import DocsPage from '@hashicorp/react-docs-page'
2021-12-13 21:21:57 +00:00
import { getStaticGenerationFunctions } from '@hashicorp/react-docs-page/server'
2020-12-07 22:04:11 +00:00
const NAV_DATA_FILE = 'data/intro-nav-data.json'
const CONTENT_DIR = 'content/intro'
const basePath = 'intro'
2020-12-07 22:04:11 +00:00
export default function DocsLayout(props) {
2020-12-07 22:04:11 +00:00
return (
<DocsPage
product={{ name: productName, slug: productSlug }}
baseRoute={basePath}
2020-12-07 22:04:11 +00:00
staticProps={props}
2021-12-13 21:21:57 +00:00
showVersionSelect={process.env.ENABLE_VERSIONED_DOCS === 'true'}
2020-12-07 22:04:11 +00:00
/>
)
}
2021-12-13 21:21:57 +00:00
const { getStaticPaths, getStaticProps } = getStaticGenerationFunctions(
process.env.ENABLE_VERSIONED_DOCS === 'true'
? {
strategy: 'remote',
basePath: basePath,
fallback: 'blocking',
revalidate: 360, // 1 hour
product: productSlug,
}
: {
strategy: 'fs',
localContentDir: CONTENT_DIR,
navDataFile: NAV_DATA_FILE,
product: productSlug,
}
)
2020-12-07 22:04:11 +00:00
2021-12-13 21:21:57 +00:00
export { getStaticPaths, getStaticProps }