diff --git a/apify-docs-theme/src/theme/LLMButtons/index.jsx b/apify-docs-theme/src/theme/LLMButtons/index.jsx index 4e0aa6439..63c7c28a2 100644 --- a/apify-docs-theme/src/theme/LLMButtons/index.jsx +++ b/apify-docs-theme/src/theme/LLMButtons/index.jsx @@ -55,7 +55,11 @@ const DROPDOWN_OPTIONS = [ ]; const getPrompt = (currentUrl) => `Read from ${currentUrl} so I can ask questions about it.`; -const getMarkdownUrl = (currentUrl) => `${currentUrl}.md`; +const getMarkdownUrl = (currentUrl) => { + const url = new URL(currentUrl); + url.pathname = `${url.pathname.replace(/\/$/, '')}.md`; + return url.toString(); +}; const onOpenInChatGPTClick = () => { if (window.analytics) {