Skip to content

Commit b9301cb

Browse files
committed
feat: refactor OpenAPI blog configuration into separate module
1 parent 55817bb commit b9301cb

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

docusaurus.config.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type * as Preset from '@docusaurus/preset-classic';
44
import Navbar from "./src/configs/navbar";
55
import PrismConfig from "./src/configs/prism";
66
import type * as OpenApiPlugin from "docusaurus-plugin-openapi-docs";
7+
import { CSlantBlogConfig } from "./src/configs/openApiPlugins";
78

89
require('dotenv').config();
910
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
@@ -79,13 +80,7 @@ const config: Config = {
7980
id: "openapi",
8081
docsPluginId: "classic",
8182
config: {
82-
blog: {
83-
outputDir: "docs/blog",
84-
specPath: `${process.env.OPENAPI_DOCS_BLOG_URL}`,
85-
sidebarOptions: {
86-
groupPathsBy: "tag",
87-
},
88-
} satisfies OpenApiPlugin.Options,
83+
blog: CSlantBlogConfig satisfies OpenApiPlugin.Options,
8984
},
9085
},
9186
],

src/configs/openApiPlugins.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export const CSlantBlogConfig = {
2+
outputDir: "docs/blog",
3+
specPath: `${process.env.OPENAPI_DOCS_BLOG_URL}`,
4+
sidebarOptions: {
5+
groupPathsBy: "tag",
6+
},
7+
};

0 commit comments

Comments
 (0)