import { productName, productSlug } from 'data/metadata' import DocsPage from '@hashicorp/react-docs-page' import PluginTierLabel from 'components/plugin-tier-label' import DevAlert from 'components/dev-alert' // Imports below are only used server-side import { generateStaticPaths, generateStaticProps, } from 'components/remote-plugin-docs/server' // Configure the docs path and remote plugin docs loading const additionalComponents = { PluginTierLabel } const baseRoute = 'docs' const localContentDir = 'content/docs' const mainBranch = 'master' const navDataFile = 'data/docs-nav-data.json' const product = { name: productName, slug: productSlug } const remotePluginsFile = 'data/docs-remote-plugins.json' function DocsLayout({ isDevMissingRemotePlugins, ...props }) { return ( <> {isDevMissingRemotePlugins ? ( Note for local development

🚨 {' '} This preview is missing plugin docs pulled from remote repos.

🛠 {' '} To preview docs pulled from plugin repos, please include a GITHUB_API_TOKEN in{' '} website/.env.local.

) : null} ) } export async function getStaticPaths() { const paths = await generateStaticPaths({ localContentDir, navDataFile, remotePluginsFile, }) return { paths, fallback: false } } export async function getStaticProps({ params }) { const props = await generateStaticProps({ additionalComponents, localContentDir, mainBranch, navDataFile, params, product, remotePluginsFile, }) return { props } } export default DocsLayout