5b53b5aef5
* website: migrate to new nav-data format * website: clean up unused intro content * website: remove deprecated sidebar_title from frontmatter * website: add react-content to fix global style import issue
37 lines
992 B
JavaScript
37 lines
992 B
JavaScript
import { productName, productSlug } from 'data/metadata'
|
|
import DocsPage from '@hashicorp/react-docs-page'
|
|
// Imports below are only used server-side
|
|
import {
|
|
generateStaticPaths,
|
|
generateStaticProps,
|
|
} from '@hashicorp/react-docs-page/server'
|
|
|
|
// Configure the docs path
|
|
const baseRoute = 'commands'
|
|
const navDataFile = `data/${baseRoute}-nav-data.json`
|
|
const localContentDir = `content/${baseRoute}`
|
|
const mainBranch = 'master'
|
|
const product = { name: productName, slug: productSlug }
|
|
|
|
export default function CommandsLayout(props) {
|
|
return (
|
|
<DocsPage baseRoute={baseRoute} product={product} staticProps={props} />
|
|
)
|
|
}
|
|
|
|
export async function getStaticPaths() {
|
|
const paths = await generateStaticPaths({ localContentDir, navDataFile })
|
|
return { paths, fallback: false }
|
|
}
|
|
|
|
export async function getStaticProps({ params }) {
|
|
const props = await generateStaticProps({
|
|
localContentDir,
|
|
mainBranch,
|
|
navDataFile,
|
|
params,
|
|
product,
|
|
})
|
|
return { props }
|
|
}
|