website: upgrade to docusaurus 2beta3

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-07-13 12:46:29 +02:00
parent b7835a751b
commit cd0a6f2d7c
4 changed files with 3766 additions and 3343 deletions

7074
website/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -12,8 +12,8 @@
"serve": "docusaurus serve" "serve": "docusaurus serve"
}, },
"dependencies": { "dependencies": {
"@docusaurus/plugin-client-redirects": "*", "@docusaurus/plugin-client-redirects": "2.0.0-beta.3",
"@docusaurus/preset-classic": "2.0.0-beta.0", "@docusaurus/preset-classic": "2.0.0-beta.3",
"@mdx-js/react": "^1.6.22", "@mdx-js/react": "^1.6.22",
"clsx": "^1.1.1", "clsx": "^1.1.1",
"postcss": "^8.3.5", "postcss": "^8.3.5",

View file

@ -2,14 +2,17 @@ import React from "react";
import Layout from "@theme/Layout"; import Layout from "@theme/Layout";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import useBaseUrl from "@docusaurus/useBaseUrl"; import useBaseUrl from "@docusaurus/useBaseUrl";
import BrowserOnly from "@docusaurus/core/lib/client/exports/BrowserOnly";
function APIBrowser() { function APIBrowser() {
const context = useDocusaurusContext(); const context = useDocusaurusContext();
const { siteConfig = {} } = context; const { siteConfig = {} } = context;
import('rapidoc');
return ( return (
<Layout title="API Browser" description={siteConfig.tagline}> <Layout title="API Browser" description={siteConfig.tagline}>
<rapi-doc <BrowserOnly>
{() => {
import('rapidoc');
return <rapi-doc
spec-url={useBaseUrl("schema.yaml")} spec-url={useBaseUrl("schema.yaml")}
allow-try="false" allow-try="false"
show-header="false" show-header="false"
@ -19,6 +22,8 @@ function APIBrowser() {
allow-spec-url-load="false" allow-spec-url-load="false"
allow-spec-file-load="false"> allow-spec-file-load="false">
</rapi-doc> </rapi-doc>
}}
</BrowserOnly>
</Layout> </Layout>
); );
} }

View file

@ -105,7 +105,7 @@ function Home() {
<div> <div>
<BrowserOnly> <BrowserOnly>
{() => { {() => {
const ReactBeforeSliderComponent = require('react-before-after-slider-component').default; const ReactBeforeSliderComponent = require('react-before-after-slider-component');
return <ReactBeforeSliderComponent return <ReactBeforeSliderComponent
firstImage={{ firstImage={{
id: 1, id: 1,
@ -150,7 +150,7 @@ function Home() {
<div> <div>
<BrowserOnly> <BrowserOnly>
{() => { {() => {
const ReactBeforeSliderComponent = require('react-before-after-slider-component').default; const ReactBeforeSliderComponent = require('react-before-after-slider-component');
return <ReactBeforeSliderComponent return <ReactBeforeSliderComponent
firstImage={{ firstImage={{
id: 1, id: 1,