From 781aaafcf1ace107e19bfd51ae0923c9518cbbfe Mon Sep 17 00:00:00 2001 From: Arzumify Date: Sat, 3 Aug 2024 15:33:14 +0100 Subject: [PATCH] Prevented the page's respective .html to show up in the package list --- assets/js/fetchPackages.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/fetchPackages.js b/assets/js/fetchPackages.js index cc5065d..c7838ca 100644 --- a/assets/js/fetchPackages.js +++ b/assets/js/fetchPackages.js @@ -13,7 +13,7 @@ async function fetchPackages(uri) { linksNodeList.forEach((link) => { const linkText = link.innerHTML.trim(); const forbiddenLinks = ["Name", "Last modified", "Size", "Description", "Parent Directory"]; - if (!forbiddenLinks.includes(linkText)) { + if (!forbiddenLinks.includes(linkText) && !linkText.endsWith(".html")) { const packageLink = document.createElement("a"); const newRedirect = uri + "/" + link.href.split("/").pop(); packageLink.href = newRedirect; @@ -29,4 +29,4 @@ async function fetchPackages(uri) { console.error('Parsing error:', e); statusText.innerHTML = "Failed to fetch packages. Please try again later."; } -} \ No newline at end of file +}