2020-05-21 17:18:17 +00:00
|
|
|
import DocsPage from '@hashicorp/react-docs-page'
|
2020-07-02 18:24:34 +00:00
|
|
|
import order from 'data/api-navigation.js'
|
2020-05-21 17:18:17 +00:00
|
|
|
import { frontMatter as data } from '../pages/api-docs/**/*.mdx'
|
|
|
|
import { MDXProvider } from '@mdx-js/react'
|
|
|
|
import Head from 'next/head'
|
|
|
|
import Link from 'next/link'
|
2020-07-02 18:24:34 +00:00
|
|
|
import Tabs, { Tab } from 'components/tabs'
|
|
|
|
import EnterpriseAlert from 'components/enterprise-alert'
|
2020-01-18 00:18:09 +00:00
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
const DEFAULT_COMPONENTS = { Tabs, Tab, EnterpriseAlert }
|
|
|
|
|
|
|
|
export default function ApiLayoutWrapper(pageMeta) {
|
2020-01-18 00:18:09 +00:00
|
|
|
function ApiLayout(props) {
|
|
|
|
return (
|
2020-05-21 17:18:17 +00:00
|
|
|
<MDXProvider components={DEFAULT_COMPONENTS}>
|
|
|
|
<DocsPage
|
|
|
|
{...props}
|
|
|
|
product="vault"
|
|
|
|
head={{
|
|
|
|
is: Head,
|
|
|
|
title: `${pageMeta.page_title} | Vault by HashiCorp`,
|
|
|
|
description: pageMeta.description,
|
|
|
|
siteName: 'Vault by HashiCorp',
|
|
|
|
}}
|
|
|
|
sidenav={{
|
|
|
|
Link,
|
|
|
|
category: 'api-docs',
|
|
|
|
currentPage: props.path,
|
|
|
|
data,
|
|
|
|
order,
|
|
|
|
}}
|
|
|
|
resourceURL={`https://github.com/hashicorp/vault/blob/master/website/pages/${pageMeta.__resourcePath}`}
|
|
|
|
/>
|
|
|
|
</MDXProvider>
|
2020-01-18 00:18:09 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
ApiLayout.getInitialProps = ({ asPath }) => ({ path: asPath })
|
2020-01-18 00:18:09 +00:00
|
|
|
|
|
|
|
return ApiLayout
|
|
|
|
}
|