]> juplo.de Git - website/commitdiff
Bereichs-Beschreibungen als statisches HTML statt rotierendem JS
authorKai Moritz <kai.milan.moritz@googlemail.com>
Sat, 11 Jul 2026 08:17:15 +0000 (08:17 +0000)
committerKai Moritz <kai@juplo.de>
Sun, 12 Jul 2026 10:27:24 +0000 (12:27 +0200)
Die per setInterval() rotierenden Beschreibungstexte wurden durch
statische Texte im HTML ersetzt, die durch " | " getrennt sind.
Damit entfällt der clientseitige Script-Block vollständig.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
src/components/SitemapNav.astro

index 77d68054d6796d9933b53399099cca2af292864f..06fe766d373bbcbcd50d4b081ddbab233fdb1de5 100644 (file)
@@ -119,9 +119,24 @@ const projNodeOff = (nodeUrl: string, parentUrl: string, inPath: boolean, isAlia
 
 // ── Blog URL classification ────────────────────────────────────────────────────
 const mainSections = [
-  { name: 'blog',     url: '/blog/',      title: 'Blog' },
-  { name: 'projects', url: '/projects/',  title: 'Projects' },
-  { name: 'about',    url: '/about.html', title: 'About' },
+  {
+    name: 'blog',
+    url: '/blog/',
+    title: 'Blog',
+    description: 'Java-Tipps und Tricks aus dem Entwickleralltag | Erfahrungsberichte aus Open-Source-Projekten | Technische Einblicke für Java-Entwickler'
+  },
+  {
+    name: 'projects',
+    url: '/projects/',
+    title: 'Projects',
+    description: 'Open-Source-Werkzeuge für Maven und Java | Nützliche Plugins für den Entwickleralltag | Bewährte Lösungen für typische Java-Probleme'
+  },
+  {
+    name: 'about',
+    url: '/about.html',
+    title: 'About',
+    description: 'Wer steckt hinter juplo.de? | Kontakt, Impressum und rechtliche Hinweise | Über den Autor und seine Arbeit'
+   },
 ];
 
 const onBlog             = currentUrl === '/blog/';
@@ -172,7 +187,7 @@ const activeTagSlug  = onTagTerm      ? currentUrl.replace(/^\/tags\//, '').repl
       {mainSections.map(s => (
         <li class={`m ${s.name}`}>
           <a href={s.url} class={activeSection === s.name ? 'm selected' : 'm'}>{s.title}</a><span class="sep">:</span>
-          <span class="description">Wechselnde passende Beschreibung des Bereichs</span>
+          <span class="description">{s.description}</span>
         </li>
       ))}
     </ul>
@@ -441,46 +456,3 @@ const activeTagSlug  = onTagTerm      ? currentUrl.replace(/^\/tags\//, '').repl
   </div>
   <hr class="n"/>
 </nav>
-
-<script>
-  const descriptions: Record<string, string[]> = {
-    blog: [
-      'Java-Tipps und Tricks aus dem Entwickleralltag',
-      'Erfahrungsberichte aus Open-Source-Projekten',
-      'Technische Einblicke für Java-Entwickler',
-    ],
-    projects: [
-      'Open-Source-Werkzeuge für Maven und Java',
-      'Nützliche Plugins für den Entwickleralltag',
-      'Bewährte Lösungen für typische Java-Probleme',
-    ],
-    about: [
-      'Wer steckt hinter juplo.de?',
-      'Kontakt, Impressum und rechtliche Hinweise',
-      'Über den Autor und seine Arbeit',
-    ],
-  };
-
-  const indices: Record<string, number> = {};
-  const menuItems = document.querySelectorAll<HTMLElement>('#menu > li.m');
-
-  menuItems.forEach(li => {
-    const section = Array.from(li.classList).find(c => c !== 'm');
-    if (!section || !descriptions[section]) return;
-    const span = li.querySelector<HTMLElement>('span.description');
-    if (!span) return;
-    indices[section] = 0;
-    span.textContent = descriptions[section][0];
-  });
-
-  setInterval(() => {
-    menuItems.forEach(li => {
-      const section = Array.from(li.classList).find(c => c !== 'm');
-      if (!section || !descriptions[section]) return;
-      const span = li.querySelector<HTMLElement>('span.description');
-      if (!span) return;
-      indices[section] = (indices[section] + 1) % descriptions[section].length;
-      span.textContent = descriptions[section][indices[section]];
-    });
-  }, 5000);
-</script>