mirror of
https://github.com/seerr-team/seerr.git
synced 2026-05-19 06:07:27 -04:00
refactor(docs): move REST API docs to navbar and dedicated sidebar (#3040)
This commit is contained in:
2
.github/workflows/docs-deploy.yml
vendored
2
.github/workflows/docs-deploy.yml
vendored
@@ -58,7 +58,7 @@ jobs:
|
||||
|
||||
- name: Build website
|
||||
working-directory: gen-docs
|
||||
run: pnpm gen-api-docs all && pnpm build
|
||||
run: pnpm gen-api-docs && pnpm build
|
||||
|
||||
- name: Upload Build Artifact
|
||||
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b6 # v4.0.0
|
||||
|
||||
2
.github/workflows/test-docs.yml
vendored
2
.github/workflows/test-docs.yml
vendored
@@ -59,4 +59,4 @@ jobs:
|
||||
- name: Build website
|
||||
run: |
|
||||
cd gen-docs
|
||||
pnpm build
|
||||
pnpm gen-api-docs && pnpm build
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"label": "REST API documentation",
|
||||
"position": 4,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"title": "REST API documentation",
|
||||
"description": "Create integrations with the Seerr REST API."
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,19 @@ const config: Config = {
|
||||
path: '../docs',
|
||||
editUrl: 'https://github.com/seerr-team/seerr/edit/develop/docs/',
|
||||
docItemComponent: '@theme/ApiItem',
|
||||
async sidebarItemsGenerator({
|
||||
defaultSidebarItemsGenerator,
|
||||
...args
|
||||
}) {
|
||||
const items = await defaultSidebarItemsGenerator(args);
|
||||
return items.filter(
|
||||
(item) =>
|
||||
!(
|
||||
item.type === 'category' &&
|
||||
item.label?.toLowerCase() === 'api'
|
||||
)
|
||||
);
|
||||
},
|
||||
},
|
||||
pages: false,
|
||||
theme: {
|
||||
@@ -103,6 +116,11 @@ const config: Config = {
|
||||
src: 'img/logo_full.svg',
|
||||
},
|
||||
items: [
|
||||
{
|
||||
to: '/api/seerr-api',
|
||||
label: 'REST API',
|
||||
position: 'right',
|
||||
},
|
||||
{
|
||||
to: 'blog',
|
||||
label: 'Blog',
|
||||
@@ -130,6 +148,10 @@ const config: Config = {
|
||||
label: 'Documentation',
|
||||
to: '/',
|
||||
},
|
||||
{
|
||||
label: 'REST API',
|
||||
to: '/api/seerr-api',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import type { SidebarsConfig } from '@docusaurus/plugin-content-docs';
|
||||
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
||||
import apiSidebar from '../docs/api/sidebar';
|
||||
|
||||
/**
|
||||
* Creating a sidebar enables you to:
|
||||
@@ -13,6 +15,7 @@ import type { SidebarsConfig } from '@docusaurus/plugin-content-docs';
|
||||
const sidebars: SidebarsConfig = {
|
||||
// By default, Docusaurus generates a sidebar from the docs folder structure
|
||||
documentationSidebar: [{ type: 'autogenerated', dirName: '.' }],
|
||||
apisidebar: apiSidebar,
|
||||
|
||||
// But you can create a sidebar manually
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user