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
|
|
|
import ConfigEntryReference from 'components/config-entry-reference'
|
|
|
|
// Imports below are only used server-side
|
2020-12-08 23:24:36 +00:00
|
|
|
import {
|
|
|
|
generateStaticPaths,
|
|
|
|
generateStaticProps,
|
2021-05-06 17:33:15 +00:00
|
|
|
} 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
|
2021-01-07 19:00:43 +00:00
|
|
|
const additionalComponents = { ConfigEntryReference }
|
2021-04-07 19:50:38 +00:00
|
|
|
const baseRoute = 'docs'
|
|
|
|
const navDataFile = `data/${baseRoute}-nav-data.json`
|
|
|
|
const localContentDir = `content/${baseRoute}`
|
2021-06-29 21:04:24 +00:00
|
|
|
const mainBranch = 'main'
|
2021-04-07 19:50:38 +00:00
|
|
|
const product = { name: productName, slug: productSlug }
|
2020-12-08 23:24:36 +00:00
|
|
|
|
|
|
|
export default function DocsLayout(props) {
|
|
|
|
return (
|
|
|
|
<DocsPage
|
2020-12-16 16:57:43 +00:00
|
|
|
additionalComponents={additionalComponents}
|
2021-04-07 19:50:38 +00:00
|
|
|
baseRoute={baseRoute}
|
|
|
|
product={product}
|
|
|
|
staticProps={props}
|
2020-12-08 23:24:36 +00:00
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function getStaticPaths() {
|
2021-04-23 14:51:13 +00:00
|
|
|
const paths = await generateStaticPaths({
|
|
|
|
localContentDir,
|
|
|
|
navDataFile,
|
|
|
|
})
|
2021-04-07 19:50:38 +00:00
|
|
|
return { paths, fallback: false }
|
2020-12-08 23:24:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function getStaticProps({ params }) {
|
2021-04-07 19:50:38 +00:00
|
|
|
const props = await generateStaticProps({
|
2021-01-07 19:00:43 +00:00
|
|
|
additionalComponents,
|
2021-04-07 19:50:38 +00:00
|
|
|
localContentDir,
|
|
|
|
mainBranch,
|
|
|
|
navDataFile,
|
|
|
|
params,
|
|
|
|
product,
|
2020-12-08 23:24:36 +00:00
|
|
|
})
|
2021-04-07 19:50:38 +00:00
|
|
|
return { props }
|
2020-12-08 23:24:36 +00:00
|
|
|
}
|