Skip to content

Commit 4885ffe

Browse files
committed
feat(nav): add GravityView Theming link to menu and sidebar
Surfaces the CSS Design Tokens page (/gravityview/css-tokens/) from two places, since it's a src/pages route the autogenerated sidebar can't reach: - GravityView navbar dropdown: a 'Theming' item under the main GravityView link - GravityView docs sidebar: a new sidebars-gravityview.js (autogenerated tree + a 'Theming' link), wired to the GravityView docs plugin via sidebarPath. All other products keep the default sidebars.js.
1 parent 2111629 commit 4885ffe

2 files changed

Lines changed: 35 additions & 5 deletions

File tree

docusaurus.config.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ const gravityview_nav = {
8888
position: 'left',
8989
items: [
9090
{ label: 'GravityView', href: '/docs/gravityview/' },
91+
{ label: 'Theming', href: '/gravityview/css-tokens/' },
9192
{
9293
type: 'html',
9394
value: '<hr class="dropdown-separator">',
@@ -156,15 +157,20 @@ function getProductPurchaseUrl(productId) {
156157
// Documentation is generated to ./docs/{product-id}/
157158
const product_docs_plugins = config_products
158159
.filter((product) => product?.id && product?.repo)
159-
.map((product) => [
160-
'@docusaurus/plugin-content-docs',
161-
{
160+
.map((product) => {
161+
const options = {
162162
id: product.id,
163163
path: `./docs/${product.id}`,
164164
routeBasePath: `docs/${product.id}`,
165165
tagsBasePath: 'since',
166-
},
167-
]);
166+
};
167+
// GravityView uses a custom sidebar that appends a link to the theming
168+
// (CSS Design Tokens) page; every other product uses the default sidebars.js.
169+
if (product.id === 'gravityview') {
170+
options.sidebarPath = './sidebars-gravityview.js';
171+
}
172+
return ['@docusaurus/plugin-content-docs', options];
173+
});
168174

169175
// Generate customLLMFiles configuration for each product
170176
const customLLMFiles = products_with_docs

sidebars-gravityview.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// @ts-check
2+
3+
/**
4+
* GravityView-specific sidebar.
5+
*
6+
* Same autogenerated tree as the shared sidebars.js, plus a manual link to the
7+
* CSS Design Tokens (theming) page. That page lives at /gravityview/css-tokens/
8+
* as a src/pages React route — it is NOT a doc under docs/gravityview/, so the
9+
* autogenerated sidebar can't pick it up on its own.
10+
*/
11+
12+
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
13+
const sidebars = {
14+
mainSidebar: [
15+
{ type: 'autogenerated', dirName: '.' },
16+
{
17+
type: 'link',
18+
label: 'Theming',
19+
href: '/gravityview/css-tokens/',
20+
},
21+
],
22+
};
23+
24+
export default sidebars;

0 commit comments

Comments
 (0)