Skip to content

Commit

Permalink
update (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
sambacha authored May 24, 2022
1 parent fea7e15 commit d078fca
Show file tree
Hide file tree
Showing 8 changed files with 238 additions and 117 deletions.
5 changes: 0 additions & 5 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,17 @@ const config = {
onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'manifoldfinance', // Usually your GitHub org/user name.
projectName: 'lz-api', // Usually your repo name.

// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
},

presets: [
[
'redocusaurus',
Expand Down Expand Up @@ -89,7 +86,6 @@ const config = {
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/manifoldfinance/lz-api/',
// remarkPlugins: [require("remark-import-partial")],
lastVersion: "current",
versions: {
current: {
Expand All @@ -103,7 +99,6 @@ const config = {
}),
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
Expand Down
64 changes: 0 additions & 64 deletions src/components/HomepageFeatures/index.js

This file was deleted.

105 changes: 105 additions & 0 deletions src/components/HomepageFeatures/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import React from 'react';
import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import useBaseUrl from '@docusaurus/useBaseUrl';
import clsx from 'clsx';
import styles from './styles.module.css';

const sections = [
{
title: <>Using ApiDoc Component</>,
link: '/examples/custom-page/',
description: (
<>
A page using ApiDoc component in{' '}
<a href="https://github.com/rohit-gohri/redocusaurus/blob/main/packages/docusaurus-theme-redoc">
docusaurus-theme-redoc
</a>
</>
),
},
{
title: <>Using Redoc Component</>,
link: '/examples/custom-layout/',
description: (
<>
A page with custom Layout using Redoc component in{' '}
<a href="https://github.com/rohit-gohri/redocusaurus/blob/main/packages/docusaurus-theme-redoc">
docusaurus-theme-redoc
</a>
</>
),
},
{
title: <>Using Spec URL</>,
link: '/examples/using-remote-url/',
description: (
<>
A page made automatically with{' '}
<a href="https://github.com/rohit-gohri/redocusaurus/blob/main/packages/docusaurus-plugin-redoc">
docusaurus-plugin-redoc
</a>
</>
),
},
{
title: <>Using YAML Spec</>,
link: '/examples/using-single-yaml/',
description: (
<>
A build time rendered page (no loading indicator on refresh), made
automatically with{' '}
<a href="https://github.com/rohit-gohri/redocusaurus/blob/main/packages/docusaurus-plugin-redoc">
docusaurus-plugin-redoc
</a>
</>
),
},
];

/**
*
* @param {{
* title: string | React.ReactNode;
* description: string | React.ReactNode;
* link?: string;
* }} param0
*/
function Section({ title, description, link }) {
const sectionComponent = <h3>{title}</h3>;
const fullLink = useBaseUrl(link);
return (
<div className={clsx('col col--6', styles.feature, styles.featuresCol)}>
{link ? <Link to={fullLink}>{sectionComponent}</Link> : sectionComponent}
<p>{description}</p>
</div>
);
}

function Docs() {
return (
<Layout title="Redocusaurus Example" description="With different use-cases">
<header className={clsx('hero hero--primary', styles.heroBanner)}>
<div className="container">
<h1 className="hero__title">Redocusaurus Example</h1>
<p>Redoc for Docusaurus with Dark Mode Support</p>
</div>
</header>
<main>
{sections && sections.length > 0 && (
<section className={styles.features}>
<div className="container">
<div className="row">
{sections.map((props, idx) => (
<Section key={idx} {...props} />
))}
</div>
</div>
</section>
)}
</main>
</Layout>
);
}

export default Docs;
14 changes: 14 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,17 @@
--ifm-color-primary-lightest: #4fddbf;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
}

.header-github-logo:before {
content: '';
width: 24px;
height: 24px;
display: flex;
background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")
no-repeat;
}

html[data-theme='dark'] .header-github-logo:before {
background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='white' d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")
no-repeat;
}
40 changes: 0 additions & 40 deletions src/pages/index.js

This file was deleted.

100 changes: 100 additions & 0 deletions src/pages/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import React from 'react';
import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import useBaseUrl from '@docusaurus/useBaseUrl';
import clsx from 'clsx';

import styles from './index.module.css';



const sections = [
{
title: <>🌚 Dark Mode Support</>,
description: (
<>Inbuilt support for Docusaurus Classic Theme&apos;s Dark Mode!</>
),
},
{
title: <>🧩 Customizable</>,
description: (
<>
Pass in your custom theme colors or options and it will be merged. All
components can be swizzled to suit your needs (with Typescript support)
</>
),
},
{
title: <>📑 Schema Definitions</>,
description: (
<>Use individual schema definitions directly in your MDX docs</>
),
},
{
title: <>⚡️ Blazing Fast</>,
description: (
<>
Support for
<a href="/docs/guides/build-time-rendering">
{' '}
Build Time Rendering!
</a>
</>
),
},
];

/**
*
* @param {{
* title: string | React.ReactNode;
* description: string | React.ReactNode;
* link?: string;
* }} param0
*/
function Section({ title, description, link }) {
const sectionComponent = <h3>{title}</h3>;
const fullLink = useBaseUrl(link);
return (
<div className={clsx('col col--6', styles.feature, styles.featuresCol)}>
{link ? <Link to={fullLink}>{sectionComponent}</Link> : sectionComponent}
<p>{description}</p>
</div>
);
}

function Docs() {
return (
<Layout title="Redocusaurus" description="OpenAPI documentation solution">
<header className={clsx('hero hero--primary', styles.heroBanner)}>
<div className="container">
<h1 className="hero__title">Redocusaurus</h1>
<p>OpenAPI solution for Docusaurus docs using Redoc</p>
<span>
<iframe
src="https://ghbtns.com/github-btn.html?user=rohit-gohri&amp;repo=redocusaurus&amp;type=star&amp;count=true&amp;size=large"
width={160}
height={30}
title="GitHub Stars"
/>
</span>
</div>
</header>
<main>
{sections && sections.length > 0 && (
<section className={styles.features}>
<div className="container">
<div className="row">
{sections.map((props, idx) => (
<Section key={idx} {...props} />
))}
</div>
</div>
</section>
)}
</main>
</Layout>
);
}

export default Docs;
Loading

0 comments on commit d078fca

Please sign in to comment.