Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Mlflow Mlflow Docusaurus Config

From Leeroopedia
Knowledge Sources
Domains Documentation, Web Configuration, Frontend
Last Updated 2026-02-13 20:00 GMT

Overview

Main Docusaurus configuration file that defines the MLflow documentation site structure, theme, plugins, navigation, and URL redirects.

Description

docusaurus.config.ts is the central configuration for the MLflow documentation site built with Docusaurus. It exports a Config object that controls all aspects of the documentation site.

Site Metadata: Sets the site title to "MLflow", production URL to https://mlflow.org, and uses a configurable base URL via the DOCS_BASE_URL environment variable (defaulting to /docs/latest/). It enforces trailing slashes for canonical URLs and throws on broken links, markdown links, anchors, and duplicate routes.

Theme Configuration: Uses Prism React Renderer for syntax highlighting with GitHub (light) and Dracula (dark) themes, supporting additional languages including bash, Java, R, Scala, SQL, and TOML. Integrates Algolia search with contextual search enabled. Supports dark mode by default with user preference respect. Includes Mermaid diagram support via the @docusaurus/theme-mermaid theme.

Multi-Instance Doc Plugins: Configures four separate documentation sections using @docusaurus/plugin-content-docs:

  • classic-ml -- Classic ML documentation at /ml route, using sidebarsClassicML.ts
  • genai -- GenAI documentation at /genai route, using sidebarsGenAI.ts
  • community -- Community documentation at /community route
  • self-hosting -- Self-hosting documentation at /self-hosting route

Navigation: Defines a navbar with a custom docs dropdown (ML Docs and GenAI Docs), API Reference link, Self-Hosting link, Community link, version selector, and GitHub link. Footer includes community links (Stack Overflow, LinkedIn, X) and resource links (Docs, Releases, Blog).

URL Redirects: Contains an extensive @docusaurus/plugin-client-redirects configuration with hundreds of redirect rules mapping old URLs (from previous documentation structures) to new locations. This covers GenAI/LLM redirects, tracing redirects, evaluation redirects, prompt management redirects, traditional ML redirects, and deployment redirects.

Additional Plugins: Includes Tailwind CSS plugin, @signalwire/docusaurus-plugin-llms-txt for LLM-friendly content export, and Google Tag Manager / gtag integration for analytics.

Usage

This is the root configuration file for building the MLflow documentation site. Modify it to change site-wide settings, add new documentation sections, update navigation, or configure redirects.

Code Reference

Source Location

Signature

import { themes as prismThemes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import { postProcessSidebar, apiReferencePrefix } from './docusaurusConfigUtils';
import tailwindPlugin from './src/plugins/tailwind-config.cjs';

const baseUrl = (process.env.DOCS_BASE_URL ?? '/docs/latest/').replace(/\/?$/, '/');

const config: Config = {
  title: 'MLflow',
  tagline: 'MLflow Documentation',
  url: 'https://mlflow.org',
  baseUrl: baseUrl,
  organizationName: 'mlflow',
  projectName: 'mlflow',
  onBrokenLinks: 'throw',
  // ... theme, plugins, redirects ...
};

export default config;

Import

// This file is consumed by Docusaurus build system
// Not imported directly by application code

I/O Contract

Inputs

Name Type Required Description
DOCS_BASE_URL env var No Base URL path for the docs site (default: /docs/latest/)
GTM_ID env var No Google Tag Manager container ID (default: GTM-TEST)

Outputs

Name Type Description
config Config object Docusaurus configuration consumed by the build system to generate the static documentation site

Key Configuration Sections

Documentation Plugins

Plugin ID Path Route Sidebar File
classic-ml docs/classic-ml /ml sidebarsClassicML.ts
genai docs/genai /genai sidebarsGenAI.ts
community docs/community /community communitySidebar.ts
self-hosting docs/self-hosting /self-hosting sidebarsSelfHosting.ts

Navbar Items

Item Type Description
Documentation custom-docsDropdown Dropdown with ML Docs and GenAI Docs links
API Reference link Links to generated API reference HTML
Self-Hosting docSidebar Links to self-hosting documentation section
Community docSidebar Links to community documentation section
Version Selector custom-versionSelector Allows switching between documentation versions
GitHub link Links to the MLflow GitHub repository

Usage Examples

Building the Documentation

# Build the documentation site
cd docs && npm run build

# Start development server
cd docs && npm run start

# Build with custom base URL
DOCS_BASE_URL=/docs/v3.0/ cd docs && npm run build

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment