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

42 lines
963 B
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'
import {
generateStaticPaths,
generateStaticProps,
} from '@hashicorp/react-docs-page/server'
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}
/>
)
}
export async function getStaticPaths() {
return {
fallback: false,
paths: await generateStaticPaths({
navDataFile: NAV_DATA_FILE,
localContentDir: CONTENT_DIR,
}),
}
2020-12-07 22:04:11 +00:00
}
export async function getStaticProps({ params }) {
return {
props: await generateStaticProps({
navDataFile: NAV_DATA_FILE,
localContentDir: CONTENT_DIR,
product: { name: productName, slug: productSlug },
params,
}),
}
2020-12-07 22:04:11 +00:00
}