diff --git a/website/components/enterprise-alert/README.md b/website/components/enterprise-alert/README.md deleted file mode 100644 index 46566971ba..0000000000 --- a/website/components/enterprise-alert/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# Enterprise Alert Component - -This component is an easy way to mark some content as only applicable to the enterprise version of consul. It can be used in any documentation pages in a variety of ways. The basic implementation is written as such, on its own line within a markdown file: - -```jsx - -``` - -And renders [like this](https://p176.p0.n0.cdn.getcloudapp.com/items/geuWOzkz/Screen%20Shot%202020-05-08%20at%204.17.34%20PM.png?v=2ace1c70f48cf1bbdd17f9ce96684453) - -The default text can also be replaced with custom text as such: - -```jsx - - Custom text with a link - -``` - -Which renders [as such](https://p176.p0.n0.cdn.getcloudapp.com/items/v1uDE2vQ/Screen%20Shot%202020-05-08%20at%204.18.22%20PM.png?v=3a45268830fac868be50047060bb4303) - -Finally, it can be rendered inline as a "tag" to mark a section or option as enterprise only by adding the `inline` attribute: - -```jsx - -``` - -This is typically used after a list item, or after a headline. It renders [as such](https://p176.p0.n0.cdn.getcloudapp.com/items/KouqnrOm/Screen%20Shot%202020-05-08%20at%204.16.34%20PM.png?v=ac21328916aa98a1a853cde5989058bd) diff --git a/website/components/enterprise-alert/index.jsx b/website/components/enterprise-alert/index.jsx deleted file mode 100644 index 11c5563de7..0000000000 --- a/website/components/enterprise-alert/index.jsx +++ /dev/null @@ -1,5 +0,0 @@ -import EnterpriseAlert from '@hashicorp/react-enterprise-alert' - -export default function EnterpriseAlertConsul(props) { - return -} diff --git a/website/components/tabs/README.md b/website/components/tabs/README.md deleted file mode 100644 index b5bfa41a6c..0000000000 --- a/website/components/tabs/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# Tabs Component - -> An MDX-compatible Tabs component - -This React component renders tabbed content. [Example](https://p176.p0.n0.cdn.getcloudapp.com/items/E0ubRrlq/Screen%20Recording%202020-05-08%20at%2004.40%20PM.gif?v=a1f576d2c207f4312ca14adbce8a53ac) - -## Usage - -- Use the `` tag in your markdown file to begin a tabbed content section. -- Use the `` tag with a `heading` prop to separate your markdown - -### Important - -A line must be skipped between the `` and your markdown (for both above and below said markdown). [This is a limitation of MDX also pointed out by the Docusaurus folks 🔗 ](https://v2.docusaurus.io/docs/markdown-features/#multi-language-support-code-blocks). There is work currently happening with the mdx parser to eliminate this issue. - -### Example - -```jsx - - - {/* Intentionally skipped line.. */} - ### Content - {/* Intentionally skipped line.. */} - - ### Content - -``` - -### Component Props - -`` can be provided any arbitrary `children` so long as the `heading` prop is present the React or HTML tag used to wrap markdown, that said, we provide the `` component to separate your tab content without rendering extra, unnecessary markup. - -This works: - -```jsx - - ### Content - .... - -``` - -This _does not_ work, as the `` element is missing a `heading` prop: - -```jsx - - ### Content - .... - -``` diff --git a/website/components/tabs/index.jsx b/website/components/tabs/index.jsx deleted file mode 100644 index 283e98037a..0000000000 --- a/website/components/tabs/index.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import ReactTabs from '@hashicorp/react-tabs' - -export function Tabs({ children }) { - if (!Array.isArray(children)) - throw new Error('Multiple elements required') - - return ( - ({ - heading: Block.props.heading, - // eslint-disable-next-line react/display-name - tabChildren: () => Block, - }))} - /> - ) -} - -export function Tab({ children }) { - return <>{children} -} diff --git a/website/components/tabs/style.css b/website/components/tabs/style.css deleted file mode 100644 index bedf96b4e0..0000000000 --- a/website/components/tabs/style.css +++ /dev/null @@ -1,8 +0,0 @@ -/* This is a CSS overwrite on top of the existing component styles to accommodate the Learn layout */ -.g-tabs { - & .g-grid-container, - & > .g-grid-container { - padding-left: 0; - padding-right: 0; - } -} diff --git a/website/layouts/api.jsx b/website/layouts/api.jsx index 071baa17f4..a11783a63f 100644 --- a/website/layouts/api.jsx +++ b/website/layouts/api.jsx @@ -1,18 +1,16 @@ import DocsPage from '@hashicorp/react-docs-page' import order from '../data/api-navigation.js' import { frontMatter as data } from '../pages/api-docs/**/*.mdx' -import { MDXProvider } from '@mdx-js/react' -import EnterpriseAlert from '../components/enterprise-alert' -import { Tabs, Tab } from '../components/tabs' import Head from 'next/head' import Link from 'next/link' +import { createMdxProvider } from '@hashicorp/nextjs-scripts/lib/providers/docs' -const DEFAULT_COMPONENTS = { EnterpriseAlert, Tabs, Tab } +const MDXProvider = createMdxProvider({ product: 'consul', preset: 'oss' }) function ApiDocsLayoutWrapper(pageMeta) { function ApiDocsLayout(props) { return ( - + + +

» Download Consul Tools @@ -43,16 +43,8 @@ export default function DownloadsPage({ downloadData }) { export async function getStaticProps() { return fetch(`https://releases.hashicorp.com/consul/${VERSION}/index.json`) - .then((r) => r.json()) - .then((r) => { - // TODO: restructure product-downloader to run this logic internally - return r.builds.reduce((acc, build) => { - if (!acc[build.os]) acc[build.os] = {} - acc[build.os][build.arch] = build.url - return acc - }, {}) - }) - .then((r) => ({ props: { downloadData: r } })) + .then((res) => res.json()) + .then((releaseData) => ({ props: { releaseData } })) .catch(() => { throw new Error( `-------------------------------------------------------- diff --git a/website/pages/style.css b/website/pages/style.css index f92b48c1e0..33e38f900f 100644 --- a/website/pages/style.css +++ b/website/pages/style.css @@ -40,7 +40,6 @@ @import '../components/basic-hero/style.css'; @import '../components/enterprise-comparison/style.css'; @import '../components/footer/style.css'; -@import '../components/tabs/style.css'; @import '../components/learn-callout/style.css'; @import '../components/case-study-carousel/style.css';