From cb03c4e8c56aa82e175feda88d5355c8cd5e6dc7 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Sat, 15 Aug 2026 10:12:55 +0000 Subject: [PATCH 1/2] docs: quality pass on recently changed pages --- customize/custom-scripts.mdx | 8 ++++++++ editor/pages.mdx | 2 +- editor/settings.mdx | 2 +- guides/knowledge-base.mdx | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/customize/custom-scripts.mdx b/customize/custom-scripts.mdx index b465bb2d5..92a6c8bb1 100644 --- a/customize/custom-scripts.mdx +++ b/customize/custom-scripts.mdx @@ -363,6 +363,14 @@ Custom JavaScript lets you add custom executable code globally. It is the equiva Mintlify includes any `.js` file inside your content directory on every page of your site. Custom JavaScript files run after the page becomes interactive. You cannot scope them to specific pages. When you include multiple `.js` files, they run without a guaranteed order. +To run code only on certain pages, branch on the current path inside your script. Mintlify sets `data-current-path` on `` and updates it on client-side navigation, so it stays in sync during SPA transitions: + +```js Example per-page script +if (document.documentElement.dataset.currentPath?.startsWith('/api-reference/')) { + // Run only on pages under /api-reference/. +} +``` + To load a third-party script, inject a `