/ docs / src / docusaurus.theme.js
docusaurus.theme.js
 1  export function onRouteDidUpdate({ location }) {
 2    const { pathname } = location;
 3  
 4    document.body.classList.remove('mlflow-ml-section', 'mlflow-genai-section');
 5  
 6    if (pathname.startsWith('/genai')) {
 7      document.documentElement.setAttribute('data-genai-theme', 'true');
 8      document.body.classList.add('mlflow-genai-section');
 9    } else if (pathname.startsWith('/ml')) {
10      document.documentElement.removeAttribute('data-genai-theme');
11      document.body.classList.add('mlflow-ml-section');
12    } else {
13      document.documentElement.removeAttribute('data-genai-theme');
14    }
15  }