@@ -43,32 +43,26 @@ export default defineConfig({
4343 var activeColor = 'color:var(--sl-color-text-accent)!important;';
4444 var inactiveColor = 'color:var(--sl-color-gray-2)!important;';
4545 var isHome = path === '/' || path === '/de' || path === '/de/';
46+ var isAbout = path.indexOf('/introduction') !== -1 || path.indexOf('/basics') !== -1;
47+ var isDocs = path.indexOf('/docs/') !== -1;
4648 var isRoadmap = path.indexOf('/roadmap') !== -1;
47- var isDocs = !isHome && !isRoadmap;
48- var existingDocs = rg.querySelector('a[href*="/introduction/about"]');
49- var existingRm = rg.querySelector('a[href*="/roadmap"]');
50- if (!existingDocs) {
51- var docsLink = document.createElement('a');
52- docsLink.href = prefix + '/introduction/about/';
53- docsLink.textContent = 'Docs';
54- docsLink.className = 'header-nav-link';
55- rg.appendChild(docsLink);
56- existingDocs = docsLink;
57- } else {
58- existingDocs.href = prefix + '/introduction/about/';
59- }
60- if (!existingRm) {
61- var rmLink = document.createElement('a');
62- rmLink.href = prefix + '/roadmap/overview/';
63- rmLink.textContent = 'Roadmap';
64- rmLink.className = 'header-nav-link';
65- rg.appendChild(rmLink);
66- existingRm = rmLink;
67- } else {
68- existingRm.href = prefix + '/roadmap/overview/';
69- }
70- existingDocs.style.cssText = baseStyle + (isDocs ? activeColor : inactiveColor);
71- existingRm.style.cssText = baseStyle + (isRoadmap ? activeColor : inactiveColor);
49+ var links = [
50+ { text: 'About', href: prefix + '/introduction/about/', active: isAbout },
51+ { text: 'Docs', href: prefix + '/docs/getting-started/what-is-flowmcp/', active: isDocs },
52+ { text: 'Roadmap', href: prefix + '/roadmap/overview/', active: isRoadmap }
53+ ];
54+ links.forEach(function(link) {
55+ var sel = 'a.header-nav-' + link.text.toLowerCase();
56+ var el = rg.querySelector(sel);
57+ if (!el) {
58+ el = document.createElement('a');
59+ el.textContent = link.text;
60+ el.className = 'header-nav-link header-nav-' + link.text.toLowerCase();
61+ rg.appendChild(el);
62+ }
63+ el.href = link.href;
64+ el.style.cssText = baseStyle + (link.active ? activeColor : inactiveColor);
65+ });
7266 }
7367 document.addEventListener('DOMContentLoaded', function() { addHeaderLinks(); });
7468 document.addEventListener('astro:page-load', function() { addHeaderLinks(); });
0 commit comments