From e16969667b50ccc0ac35a05f82e355aa7ed49585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=20Randall=20Havens=20=E2=96=B3=20The=20Empathic=20Tec?= =?UTF-8?q?hnologist=20=E2=9F=81=20Doctor=20Who=2042?= Date: Sat, 8 Nov 2025 19:47:58 -0600 Subject: [PATCH] Update app.js --- public/app.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/public/app.js b/public/app.js index b2ea4c9..d4bc223 100755 --- a/public/app.js +++ b/public/app.js @@ -31,12 +31,12 @@ async function init() { } } -// TOP NAV: Only folder name if ANY index.* exists +// TOP NAV: Only real section folders with index.* function populateNav() { els.primaryNav.innerHTML = 'Home'; const navSections = [...new Set( indexData.flat - .filter(f => f.isIndex) + .filter(f => f.isIndex && f.path.split("/").length > 1) .map(f => f.path.split("/")[0]) )].sort(); navSections.forEach(s => { @@ -44,7 +44,7 @@ function populateNav() { }); } -// DROPDOWN: Only sections with NON-index files + default to "posts" +// DROPDOWN: Only sections with NON-index files function populateSections() { els.sectionSelect.innerHTML = ''; indexData.sections.forEach(s => { @@ -53,7 +53,6 @@ function populateSections() { els.sectionSelect.appendChild(opt); }); - // DEFAULT TO "posts" IF EXISTS if (indexData.sections.includes("posts")) { els.sectionSelect.value = "posts"; } else if (indexData.sections.length > 0) { @@ -160,7 +159,6 @@ async function handleHash() { const html = marked.parse(src || `# ${section}\n\nNo content yet.`); els.viewer.innerHTML = `
${html}
`; } else { - // HTML/PDF: inject clean fallback const iframe = document.createElement("iframe"); iframe.src = "/" + indexFile.path; iframe.loading = "eager";