2020-12-17 21:53:33 +00:00
|
|
|
import { productName, productSlug } from 'data/metadata'
|
|
|
|
import DocsPage from '@hashicorp/react-docs-page'
|
2021-04-22 17:41:07 +00:00
|
|
|
import Columns from 'components/columns'
|
|
|
|
import Tag from 'components/inline-tag'
|
|
|
|
// Imports below are used in server-side only
|
2020-12-17 21:53:33 +00:00
|
|
|
import {
|
|
|
|
generateStaticPaths,
|
|
|
|
generateStaticProps,
|
2021-05-06 17:32:25 +00:00
|
|
|
} from '@hashicorp/react-docs-page/server'
|
2020-12-17 21:53:33 +00:00
|
|
|
|
2021-04-06 17:49:04 +00:00
|
|
|
const NAV_DATA_FILE = 'data/docs-nav-data.json'
|
|
|
|
const CONTENT_DIR = 'content/docs'
|
|
|
|
const basePath = 'docs'
|
2020-12-17 21:53:33 +00:00
|
|
|
const additionalComponents = { Columns, Tag }
|
|
|
|
|
|
|
|
export default function DocsLayout(props) {
|
|
|
|
return (
|
|
|
|
<DocsPage
|
|
|
|
product={{ name: productName, slug: productSlug }}
|
2021-04-06 17:49:04 +00:00
|
|
|
baseRoute={basePath}
|
2020-12-17 21:53:33 +00:00
|
|
|
staticProps={props}
|
|
|
|
additionalComponents={additionalComponents}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function getStaticPaths() {
|
2021-04-06 17:49:04 +00:00
|
|
|
return {
|
|
|
|
fallback: false,
|
|
|
|
paths: await generateStaticPaths({
|
|
|
|
navDataFile: NAV_DATA_FILE,
|
|
|
|
localContentDir: CONTENT_DIR,
|
|
|
|
}),
|
|
|
|
}
|
2020-12-17 21:53:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function getStaticProps({ params }) {
|
2021-04-06 17:49:04 +00:00
|
|
|
return {
|
|
|
|
props: await generateStaticProps({
|
|
|
|
navDataFile: NAV_DATA_FILE,
|
|
|
|
localContentDir: CONTENT_DIR,
|
|
|
|
product: { name: productName, slug: productSlug },
|
|
|
|
params,
|
|
|
|
additionalComponents,
|
|
|
|
}),
|
|
|
|
}
|
2020-12-17 21:53:33 +00:00
|
|
|
}
|