From 638d69d3320f4ce159d79fe47f9381b6c90ba7c2 Mon Sep 17 00:00:00 2001 From: Rohit Gohri Date: Fri, 8 Mar 2024 20:02:55 +0100 Subject: [PATCH] update website config to use folder --- website/docusaurus.config.ts | 29 +++---------------- .../components/pets.yaml | 0 .../index.openapi.yaml} | 0 ...pi.yaml => using-single-yaml.openapi.yaml} | 0 ...r.json => using-swagger-json.openapi.json} | 0 .../pages/examples/custom-layout/index.jsx | 2 +- .../src/pages/examples/custom-page/index.jsx | 2 +- 7 files changed, 6 insertions(+), 27 deletions(-) rename website/openapi/{multi-file => using-multi-file-yaml}/components/pets.yaml (100%) rename website/openapi/{multi-file/openapi.yaml => using-multi-file-yaml/index.openapi.yaml} (100%) rename website/openapi/{single-file/openapi.yaml => using-single-yaml.openapi.yaml} (100%) rename website/openapi/{swagger/swagger.json => using-swagger-json.openapi.json} (100%) diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index dc8d7d24..b31830c8 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -38,38 +38,17 @@ const config: Config = { { debug: Boolean(process.env.DEBUG || process.env.CI), config: path.join(__dirname, 'redocly.yaml'), + openapi: { + folder: 'openapi', + routeBasePath: '/examples', + }, specs: [ - { - id: 'using-single-yaml', - spec: 'openapi/single-file/openapi.yaml', - route: '/examples/using-single-yaml/', - }, - { - id: 'using-multi-file-yaml', - spec: 'openapi/multi-file/openapi.yaml', - route: '/examples/using-multi-file-yaml/', - }, - { - id: 'using-swagger-json', - spec: 'openapi/swagger/swagger.json', - route: '/examples/using-swagger-json/', - }, { id: 'using-remote-url', // Remote File spec: 'https://redocly.github.io/redoc/openapi.yaml', route: '/examples/using-remote-url/', }, - { - id: 'using-custom-page', - spec: 'openapi/single-file/openapi.yaml', - // NOTE: no `route` passed, instead data used in custom React Component ('custom-page/index.jsx') - }, - { - id: 'using-custom-layout', - spec: 'openapi/single-file/openapi.yaml', - // NOTE: no `route` passed, instead data used in custom React Component ('custom-layout/index.jsx') - }, ], theme: { /** diff --git a/website/openapi/multi-file/components/pets.yaml b/website/openapi/using-multi-file-yaml/components/pets.yaml similarity index 100% rename from website/openapi/multi-file/components/pets.yaml rename to website/openapi/using-multi-file-yaml/components/pets.yaml diff --git a/website/openapi/multi-file/openapi.yaml b/website/openapi/using-multi-file-yaml/index.openapi.yaml similarity index 100% rename from website/openapi/multi-file/openapi.yaml rename to website/openapi/using-multi-file-yaml/index.openapi.yaml diff --git a/website/openapi/single-file/openapi.yaml b/website/openapi/using-single-yaml.openapi.yaml similarity index 100% rename from website/openapi/single-file/openapi.yaml rename to website/openapi/using-single-yaml.openapi.yaml diff --git a/website/openapi/swagger/swagger.json b/website/openapi/using-swagger-json.openapi.json similarity index 100% rename from website/openapi/swagger/swagger.json rename to website/openapi/using-swagger-json.openapi.json diff --git a/website/src/pages/examples/custom-layout/index.jsx b/website/src/pages/examples/custom-layout/index.jsx index 8e019132..281f3dd8 100644 --- a/website/src/pages/examples/custom-layout/index.jsx +++ b/website/src/pages/examples/custom-layout/index.jsx @@ -4,7 +4,7 @@ import Redoc from '@theme/Redoc'; import useSpecData from '@theme/useSpecData'; function CustomPage() { - const specData = useSpecData('using-custom-layout'); + const specData = useSpecData('using-single-yaml'); return (