Configuration Reference
This page documents the key settings in docusaurus.config.ts — the single file that controls site-wide behaviour. Unlike traditional Docusaurus setups, client documentation instances are auto-discovered from the clients/ directory.
Top-Level Settings
const config: Config = {
title: 'Rhino Group Docs',
tagline: 'Multi-client documentation platform',
favicon: 'img/favicon.ico',
url: 'https://your-docs-domain.com',
baseUrl: '/',
onBrokenLinks: 'warn',
};
Client Auto-Discovery
The core mechanism that makes this platform work. At build time:
const clientsDir = path.resolve(__dirname, 'clients');
const clientSlugs = fs.readdirSync(clientsDir)
.filter(entry => fs.statSync(path.join(clientsDir, entry)).isDirectory());
Each discovered slug becomes a docs plugin instance via buildClientDocsPlugin():
function buildClientDocsPlugin(clientSlug: string): [string, DocsPluginOptions] {
return [
'@docusaurus/plugin-content-docs',
{
id: clientSlug,
path: `clients/${clientSlug}`,
routeBasePath: clientSlug,
sidebarPath: require.resolve('./sidebars/autogenerated'),
},
];
}
Custom Client Labels
Slugs that don't title-case correctly need an override:
const customClientLabels: Record<string, string> = {
'gsm-outdoors': 'GSM Outdoors',
};
This is checked by slugToLabel() before falling back to title-casing the slug.
Shared Sidebar Config
All clients use the same sidebar configuration — auto-generated from the filesystem:
// sidebars/autogenerated.ts
const sidebars = {
docs: [{type: 'autogenerated', dirName: '.'}],
};
Sidebar ordering is controlled by _category_.json files and sidebar_position frontmatter in each client's content directory.
Typesense Search Theme
Search is provided by docusaurus-theme-search-typesense:
themes: ['docusaurus-theme-search-typesense'],
Configuration in themeConfig:
typesense: {
typesenseCollectionName: 'rhino-docs',
typesenseServerConfig: {
nodes: [{
host: 'localhost',
port: 8108,
protocol: 'http',
}],
apiKey: '<search-only-key>',
},
contextualSearch: false,
},
contextualSearch must be false because our faceted search uses custom filter_by parameters managed by the swizzled SearchBar component.
Meta Plugin
The docsearch-meta-plugin injects client and site meta tags into built HTML as a postBuild hook:
plugins: [
[require.resolve('./plugins/docsearch-meta-plugin'), { clientsDir: 'clients' }],
],
It has its own customLabels map for slug → label overrides, which must be kept in sync with customClientLabels in the main config.
Navbar
The navbar is auto-generated with a "Clients" dropdown containing links to each client's landing page. New clients appear automatically after a build — no manual config changes needed.
Adding a New Client
No changes to docusaurus.config.ts are needed. Simply:
- Create
clients/{client-slug}/with anindex.md - Add site directories with
_category_.jsonand content - Add the client to
clientListinsrc/pages/index.tsx - Add the client to
clientRegistryinsrc/theme/SearchBar/index.tsx - If the slug doesn't title-case correctly, add it to both
customClientLabelsand the plugin'scustomLabels
Or use the automated wizard: scripts/create-new-client-site.ps1