fix docsite prettier
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
This commit is contained in:
@@ -23,7 +23,7 @@ import type * as Preset from '@docusaurus/preset-classic';
|
||||
import { Config } from '@docusaurus/types';
|
||||
import RedirectPlugin from '@docusaurus/plugin-client-redirects';
|
||||
import { releases } from './releases';
|
||||
import type * as OpenApiPlugin from "docusaurus-plugin-openapi-docs";
|
||||
import type * as OpenApiPlugin from 'docusaurus-plugin-openapi-docs';
|
||||
|
||||
const backstageTheme = themes.vsDark;
|
||||
backstageTheme.plain.backgroundColor = '#232323';
|
||||
@@ -59,9 +59,9 @@ const defaultOpenApiOptions = {
|
||||
hideSendButton: true,
|
||||
sidebarOptions: {
|
||||
groupPathsBy: 'tag',
|
||||
categoryLinkSource: 'tag'
|
||||
categoryLinkSource: 'tag',
|
||||
},
|
||||
} satisfies OpenApiPlugin.Options
|
||||
} satisfies OpenApiPlugin.Options;
|
||||
|
||||
const config: Config = {
|
||||
title: 'Backstage Software Catalog and Developer Platform',
|
||||
@@ -119,7 +119,7 @@ const config: Config = {
|
||||
},
|
||||
}
|
||||
: undefined),
|
||||
docItemComponent: "@theme/ApiItem",
|
||||
docItemComponent: '@theme/ApiItem',
|
||||
},
|
||||
blog: {
|
||||
path: 'blog',
|
||||
@@ -279,24 +279,24 @@ const config: Config = {
|
||||
[
|
||||
'docusaurus-plugin-openapi-docs',
|
||||
{
|
||||
id: "api", // plugin id
|
||||
docsPluginId: "classic", // configured for preset-classic
|
||||
id: 'api', // plugin id
|
||||
docsPluginId: 'classic', // configured for preset-classic
|
||||
config: {
|
||||
catalog: {
|
||||
...defaultOpenApiOptions,
|
||||
specPath: "../plugins/catalog-backend/src/schema/openapi.yaml",
|
||||
outputDir: "../docs/features/software-catalog/api",
|
||||
specPath: '../plugins/catalog-backend/src/schema/openapi.yaml',
|
||||
outputDir: '../docs/features/software-catalog/api',
|
||||
} satisfies OpenApiPlugin.Options,
|
||||
search: {
|
||||
...defaultOpenApiOptions,
|
||||
specPath: "../plugins/search-backend/src/schema/openapi.yaml",
|
||||
outputDir: "../docs/features/search/api",
|
||||
specPath: '../plugins/search-backend/src/schema/openapi.yaml',
|
||||
outputDir: '../docs/features/search/api',
|
||||
} satisfies OpenApiPlugin.Options,
|
||||
}
|
||||
},
|
||||
},
|
||||
]
|
||||
],
|
||||
],
|
||||
themes: ["docusaurus-theme-openapi-docs"],
|
||||
themes: ['docusaurus-theme-openapi-docs'],
|
||||
themeConfig: {
|
||||
colorMode: {
|
||||
defaultMode: 'dark',
|
||||
|
||||
+36
-26
@@ -1,15 +1,19 @@
|
||||
import { releases } from './releases';
|
||||
|
||||
function tryToLoadCustomSidebar(ref){
|
||||
try{
|
||||
return require(ref)
|
||||
function tryToLoadCustomSidebar(ref) {
|
||||
try {
|
||||
return require(ref);
|
||||
} catch (e) {
|
||||
return []
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
const catalogSidebar = tryToLoadCustomSidebar("../docs/features/software-catalog/api/sidebar.ts")
|
||||
const searchSidebar = tryToLoadCustomSidebar("../docs/features/search/api/sidebar.ts")
|
||||
const catalogSidebar = tryToLoadCustomSidebar(
|
||||
'../docs/features/software-catalog/api/sidebar.ts',
|
||||
);
|
||||
const searchSidebar = tryToLoadCustomSidebar(
|
||||
'../docs/features/search/api/sidebar.ts',
|
||||
);
|
||||
|
||||
export default {
|
||||
docs: {
|
||||
@@ -148,16 +152,19 @@ export default {
|
||||
'features/search/getting-started',
|
||||
'features/search/concepts',
|
||||
{
|
||||
type: "category",
|
||||
label: "API",
|
||||
link: searchSidebar.length > 0 ? {
|
||||
type: "generated-index",
|
||||
title: "Search API",
|
||||
slug: "/category/search-api",
|
||||
} : {
|
||||
type: "doc",
|
||||
id: "openapi/generated-docs/404",
|
||||
},
|
||||
type: 'category',
|
||||
label: 'API',
|
||||
link:
|
||||
searchSidebar.length > 0
|
||||
? {
|
||||
type: 'generated-index',
|
||||
title: 'Search API',
|
||||
slug: '/category/search-api',
|
||||
}
|
||||
: {
|
||||
type: 'doc',
|
||||
id: 'openapi/generated-docs/404',
|
||||
},
|
||||
items: searchSidebar,
|
||||
},
|
||||
'features/search/architecture',
|
||||
@@ -183,16 +190,19 @@ export default {
|
||||
'features/software-catalog/external-integrations',
|
||||
'features/software-catalog/catalog-customization',
|
||||
{
|
||||
type: "category",
|
||||
label: "API",
|
||||
link: catalogSidebar.length > 0 ? {
|
||||
type: "generated-index",
|
||||
title: "Catalog API",
|
||||
slug: "/category/catalog-api",
|
||||
}: {
|
||||
type: "doc",
|
||||
id: "openapi/generated-docs/404",
|
||||
},
|
||||
type: 'category',
|
||||
label: 'API',
|
||||
link:
|
||||
catalogSidebar.length > 0
|
||||
? {
|
||||
type: 'generated-index',
|
||||
title: 'Catalog API',
|
||||
slug: '/category/catalog-api',
|
||||
}
|
||||
: {
|
||||
type: 'doc',
|
||||
id: 'openapi/generated-docs/404',
|
||||
},
|
||||
items: catalogSidebar,
|
||||
},
|
||||
'features/software-catalog/creating-the-catalog-graph',
|
||||
|
||||
Reference in New Issue
Block a user