packer-cn/website/layouts/guides.jsx

37 lines
971 B
React
Raw Normal View History

2020-03-18 18:46:47 -04:00
import DocsPage from '@hashicorp/react-docs-page'
2020-05-29 17:13:27 -04:00
import order from 'data/guides-navigation.js'
2020-03-18 18:46:47 -04:00
import { frontMatter as data } from '../pages/guides/**/*.mdx'
import Head from 'next/head'
import Link from 'next/link'
function GuidesLayoutWrapper(pageMeta) {
function GuidesLayout(props) {
return (
<DocsPage
{...props}
product="packer"
head={{
is: Head,
title: `${pageMeta.page_title} | Packer by HashiCorp`,
description: pageMeta.description,
2020-05-29 17:13:27 -04:00
siteName: 'Packer by HashiCorp',
2020-03-18 18:46:47 -04:00
}}
sidenav={{
Link,
category: 'guides',
currentPage: props.path,
data,
2020-05-29 17:13:27 -04:00
order,
2020-03-18 18:46:47 -04:00
}}
resourceURL={`https://github.com/hashicorp/packer/blob/master/website/pages/${pageMeta.__resourcePath}`}
/>
)
}
GuidesLayout.getInitialProps = ({ asPath }) => ({ path: asPath })
return GuidesLayout
}
export default GuidesLayoutWrapper