"Fossies" - the Fresh Open Source Software Archive

Member "vagrant-2.2.14/website/layouts/docs.jsx" (20 Nov 2020, 1598 Bytes) of package /linux/misc/vagrant-2.2.14.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) JSX source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "docs.jsx": 2.2.10_vs_2.2.11.

    1 import Head from 'next/head'
    2 import Link from 'next/link'
    3 import { createMdxProvider } from '@hashicorp/nextjs-scripts/lib/providers/docs'
    4 import DocsPage from '@hashicorp/react-docs-page'
    5 import Button from '@hashicorp/react-button'
    6 import { SearchProvider } from '@hashicorp/react-search'
    7 import SearchBar from '../components/search-bar'
    8 import { frontMatter as data } from '../pages/docs/**/*.mdx'
    9 import order from '../data/docs-navigation.js'
   10 
   11 const MDXProvider = createMdxProvider({
   12   product: 'vagrant',
   13   additionalComponents: { Button },
   14 })
   15 
   16 function DocsLayoutWrapper(pageMeta) {
   17   function DocsLayout(props) {
   18     const { children, ...propsWithoutChildren } = props
   19     return (
   20       <MDXProvider>
   21         <DocsPage
   22           {...propsWithoutChildren}
   23           product="vagrant"
   24           head={{
   25             is: Head,
   26             title: `${pageMeta.page_title} | Vagrant by HashiCorp`,
   27             description: pageMeta.description,
   28             siteName: 'Vagrant by HashiCorp',
   29           }}
   30           sidenav={{
   31             Link,
   32             category: 'docs',
   33             currentPage: props.path,
   34             data,
   35             disableFilter: true,
   36             order,
   37           }}
   38           resourceURL={`https://github.com/hashicorp/vagrant/blob/main/website/pages/${pageMeta.__resourcePath}`}
   39         >
   40           <SearchProvider>
   41             <SearchBar />
   42             {children}
   43           </SearchProvider>
   44         </DocsPage>
   45       </MDXProvider>
   46     )
   47   }
   48 
   49   DocsLayout.getInitialProps = ({ asPath }) => ({ path: asPath })
   50 
   51   return DocsLayout
   52 }
   53 
   54 export default DocsLayoutWrapper