<MarkdownPage> ComponentThis component is intended to take in a local markdown file and render it as a single page. It ships with a server file that exposes a getStaticProps generator.
<MarkdownPage// pass in the results of executing the 'generateStaticProps' function from '@hashicorp/react-markdown-page/server'staticProps={staticPropsResult}/>
| Name | Description |
|---|---|
componentsobject | An object in which the key is the name of a react component, and the value is the actual component. Identical objects should be passed to generateStaticProps and <MarkdownPage /> if used. |
staticProps*object | the return value from the generateStaticProps function from @hashicorp/react-markdown-page/server. See docs for details. |
getStaticPropsThe code sample above shows the component as rendered - this one shows how it would be used in conjuction with generateStaticProps:
If you would like to use markdown components within the page, you can pass a components argument to both generateStaticProps and <MarkdownPage />, as such: