add first version using docusaurus-openapi-docs

This commit is contained in:
Pascal Fischer
2023-04-26 15:06:59 +02:00
parent d95022d98e
commit 2ac424d37b
89 changed files with 14438 additions and 6624 deletions

View File

@@ -18,12 +18,15 @@ const config = {
presets: [
[
'@docusaurus/preset-classic',
'classic',
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
routeBasePath: '/',
editUrl: 'https://github.com/netbirdio/docs/tree/main',
docLayoutComponent: "@theme/DocPage",
docItemComponent: "@theme/ApiItem"
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
@@ -36,6 +39,29 @@ const config = {
],
],
plugins: [
[
'docusaurus-plugin-openapi-docs',
{
id: "apiDocs",
docsPluginId: "classic",
config: {
api: {
// specPath: "petstore.yaml",
specPath: "openapi.yml",
// specPath: "https://raw.githubusercontent.com/netbirdio/netbird/main/management/server/http/api/openapi.yml", // Path to designated spec file
outputDir: "docs/api", // Output directory for generated .mdx docs
sidebarOptions: {
groupPathsBy: "tag",
categoryLinkSource: "none",
},
}
}
},
],
],
themes: ["docusaurus-theme-openapi-docs"], // Allows use of @theme/ApiItem and other components
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
@@ -56,10 +82,17 @@ const config = {
}, // or position: 'right'
{
type: 'doc',
docId: 'introduction',
docId: 'documentation/introduction',
position: 'right',
label: 'Docs',
},
{
type: 'doc',
docId: 'api/netbird-rest-api',
// docId: 'api/add-pet',
position: 'right',
label: 'API',
},
{
to: 'https://netbird.io/blog/',
label: 'Blog',
@@ -85,6 +118,11 @@ const config = {
textColor: '#091E42',
isCloseable: true,
},
docs: {
sidebar: {
autoCollapseCategories: true
},
}
}),
};