|
| 1 | +const pages = [ |
| 2 | + { title: "Overview", href: "pages/overview.html" }, |
| 3 | + { title: "Service Definition", href: "pages/service-definition.html" }, |
| 4 | + { title: "Operating Model", href: "pages/operating-model.html" }, |
| 5 | + { title: "Architecture", href: "pages/architecture.html" }, |
| 6 | + { title: "KPIs", href: "pages/kpis.html" }, |
| 7 | + { title: "Roadmap", href: "pages/roadmap.html" }, |
| 8 | + { title: "Runbooks", href: "pages/runbooks.html" }, |
| 9 | + { title: "Templates", href: "pages/templates.html" }, |
| 10 | + { title: "Hybrid", href: "pages/hybrid.html" } |
| 11 | +]; |
| 12 | + |
| 13 | +function buildNav() { |
| 14 | + const nav = document.getElementById("nav-links"); |
| 15 | + pages.forEach((page) => { |
| 16 | + const link = document.createElement("a"); |
| 17 | + link.href = page.href; |
| 18 | + link.textContent = page.title; |
| 19 | + nav.appendChild(link); |
| 20 | + }); |
| 21 | +} |
| 22 | + |
| 23 | +function setupSearch() { |
| 24 | + const input = document.getElementById("search"); |
| 25 | + if (!input) return; |
| 26 | + input.addEventListener("input", (event) => { |
| 27 | + const query = event.target.value.toLowerCase(); |
| 28 | + const results = pages.filter((page) => |
| 29 | + page.title.toLowerCase().includes(query) |
| 30 | + ); |
| 31 | + const nav = document.getElementById("nav-links"); |
| 32 | + nav.innerHTML = ""; |
| 33 | + results.forEach((page) => { |
| 34 | + const link = document.createElement("a"); |
| 35 | + link.href = page.href; |
| 36 | + link.textContent = page.title; |
| 37 | + nav.appendChild(link); |
| 38 | + }); |
| 39 | + }); |
| 40 | +} |
| 41 | + |
| 42 | +buildNav(); |
| 43 | +setupSearch(); |
0 commit comments