Skip to content

Commit 64e45f5

Browse files
vdusekclaude
andcommitted
docs: restructure versioned docs sidebar and add version-aware navbar
Unify sidebar structure across all doc versions to: Overview, Quick start, Concepts, Examples/Guides, Upgrading, Changelog. For v1.12, merge the multi-page Overview section into a single Overview page and add a dedicated Quick start page. Rename directory from overview to introduction for consistent doc IDs across versions. Add custom VersionedReferenceNavbarItem component so the Reference tab follows the selected docs version. Make Docs and Changelog tabs version-aware using Docusaurus type: 'doc' navbar items. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 927092f commit 64e45f5

File tree

15 files changed

+118
-97
lines changed

15 files changed

+118
-97
lines changed

website/docusaurus.config.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,21 @@ module.exports = {
6666
title: 'API Client for Python',
6767
items: [
6868
{
69-
to: 'docs',
69+
type: 'doc',
70+
docId: 'introduction/introduction',
7071
label: 'Docs',
7172
position: 'left',
7273
activeBaseRegex: '/docs(?!/changelog)',
7374
},
7475
{
75-
to: '/reference',
76+
type: 'custom-versioned-reference',
7677
label: 'Reference',
7778
position: 'left',
7879
activeBaseRegex: '/reference',
7980
},
8081
{
81-
to: 'docs/changelog',
82+
type: 'doc',
83+
docId: 'changelog',
8284
label: 'Changelog',
8385
position: 'left',
8486
activeBaseRegex: '/docs/changelog',
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import OriginalComponentTypes from '@theme-original/NavbarItem/ComponentTypes';
2+
import VersionedReferenceNavbarItem from './VersionedReferenceNavbarItem';
3+
4+
export default {
5+
...OriginalComponentTypes,
6+
'custom-versioned-reference': VersionedReferenceNavbarItem,
7+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from 'react';
2+
import { useDocsVersionCandidates } from '@docusaurus/plugin-content-docs/client';
3+
import DefaultNavbarItem from '@theme/NavbarItem/DefaultNavbarItem';
4+
5+
/* eslint-disable react/prop-types */
6+
export default function VersionedReferenceNavbarItem({ docsPluginId, ...props }) {
7+
const [version] = useDocsVersionCandidates(docsPluginId);
8+
9+
// Latest version → /reference, "current" (next) → /reference/next, others → /reference/{name}
10+
let to = '/reference';
11+
if (!version.isLast) {
12+
to = `/reference/${version.name === 'current' ? 'next' : version.name}`;
13+
}
14+
15+
return <DefaultNavbarItem {...props} to={to} />;
16+
}

website/versioned_docs/version-1.12/01_overview/code/01_usage_async.py renamed to website/versioned_docs/version-1.12/01_introduction/code/01_usage_async.py

File renamed without changes.

website/versioned_docs/version-1.12/01_overview/code/01_usage_sync.py renamed to website/versioned_docs/version-1.12/01_introduction/code/01_usage_sync.py

File renamed without changes.

website/versioned_docs/version-1.12/01_overview/code/02_auth_async.py renamed to website/versioned_docs/version-1.12/01_introduction/code/02_auth_async.py

File renamed without changes.

website/versioned_docs/version-1.12/01_overview/code/02_auth_sync.py renamed to website/versioned_docs/version-1.12/01_introduction/code/02_auth_sync.py

File renamed without changes.

website/versioned_docs/version-1.12/01_overview/code/03_dataset_async.py renamed to website/versioned_docs/version-1.12/01_introduction/code/03_dataset_async.py

File renamed without changes.

website/versioned_docs/version-1.12/01_overview/code/03_dataset_sync.py renamed to website/versioned_docs/version-1.12/01_introduction/code/03_dataset_sync.py

File renamed without changes.

website/versioned_docs/version-1.12/01_overview/code/03_input_async.py renamed to website/versioned_docs/version-1.12/01_introduction/code/03_input_async.py

File renamed without changes.

0 commit comments

Comments
 (0)