From 69aaffc67a0bc863af7f87b6d899231e307e9df8 Mon Sep 17 00:00:00 2001 From: ishavyas9 Date: Mon, 7 Oct 2024 18:05:41 +0530 Subject: [PATCH] api doc update --- src/pages/api-doc/index.jsx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/pages/api-doc/index.jsx b/src/pages/api-doc/index.jsx index 9d4edaf49..b11c6ab3a 100644 --- a/src/pages/api-doc/index.jsx +++ b/src/pages/api-doc/index.jsx @@ -2,8 +2,33 @@ import React, { useState, useEffect } from 'react'; import Layout from '@theme/Layout'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; +import { useLocation } from 'react-router-dom'; function ApiDoc() { + const location = useLocation(); + useEffect(() => { + console.log(location.pathname) + if (location.pathname === '/support/api-doc/') { + const removeAlternateLinks = () => { + const alternateLinks = document.querySelectorAll('link[rel="alternate"]'); + alternateLinks.forEach(link => link.parentNode.removeChild(link)); + }; + + removeAlternateLinks(); + + const observer = new MutationObserver((mutationsList) => { + for (const mutation of mutationsList) { + if (mutation.type === 'childList') { + removeAlternateLinks(); + } + } + }); + + observer.observe(document.body, { childList: true, subtree: true }); + + return () => observer.disconnect(); + } + }, [location.pathname]); return (