diff --git a/_includes/js/custom.js b/_includes/js/custom.js index 5978eae..3624ac0 100644 --- a/_includes/js/custom.js +++ b/_includes/js/custom.js @@ -1,7 +1,6 @@ document.addEventListener('DOMContentLoaded', function() { const currentUrl = window.location.href; document.querySelector(".nav-list").style.display = 'block' - // check if we are in the user guid tabs if (currentUrl.includes('user_guide')) { const parts = currentUrl.split('/'); @@ -22,10 +21,18 @@ document.addEventListener('DOMContentLoaded', function() { } } - console.log('execute') + // Remove the logo of the portal from the nav if it doesn't have the current page + const navLinks = Array.from(document.getElementById('ontoportal_tabs').querySelectorAll('a')); + navLinks.forEach(navLink => { + fetch(navLink.href) + .then(response => { + if (response.status === 404) { + navLink.remove(); + } + }); + }); + } else { document.querySelector(".breadcrumb-nav").style.display = 'block' - } - });