|
39 | 39 | </a> |
40 | 40 | </li> |
41 | 41 | <li class="nav-item"> |
42 | | - <a href="en/getting-started.md" class="nav-link"> |
| 42 | + <a href="en/getting-started.html" class="nav-link"> |
43 | 43 | <ion-icon name="rocket-outline"></ion-icon> |
44 | 44 | <span>Getting Started</span> |
45 | 45 | </a> |
46 | 46 | </li> |
47 | 47 | <li class="nav-item"> |
48 | | - <a href="en/core-concepts.md" class="nav-link"> |
| 48 | + <a href="en/core-concepts.html" class="nav-link"> |
49 | 49 | <ion-icon name="book-outline"></ion-icon> |
50 | 50 | <span>Core Concepts</span> |
51 | 51 | </a> |
52 | 52 | </li> |
53 | 53 | <li class="nav-item"> |
54 | | - <a href="en/api/README.md" class="nav-link"> |
| 54 | + <a href="en/api/README.html" class="nav-link"> |
55 | 55 | <ion-icon name="code-slash-outline"></ion-icon> |
56 | 56 | <span>API Reference</span> |
57 | 57 | </a> |
@@ -94,7 +94,7 @@ <h1 class="hero-title">A lightweight Java framework for modern apps</h1> |
94 | 94 | </p> |
95 | 95 |
|
96 | 96 | <div class="hero-actions"> |
97 | | - <a href="en/getting-started.md" class="btn btn-primary"> |
| 97 | + <a href="en/getting-started.html" class="btn btn-primary"> |
98 | 98 | Get Started |
99 | 99 | <ion-icon name="arrow-forward-outline" style="margin-left: 0.5rem;"></ion-icon> |
100 | 100 | </a> |
@@ -363,31 +363,33 @@ <h4>Zero Configuration</h4> |
363 | 363 | sidebarLinks.forEach((link, index) => { |
364 | 364 | const key = sidebarKeys[index]; |
365 | 365 | const span = link.querySelector('span'); |
366 | | - if (span) { |
| 366 | + if (span && t['sidebar'][key]) { |
367 | 367 | span.textContent = t['sidebar'][key]; |
368 | 368 | } |
369 | 369 |
|
370 | 370 | // Update hrefs for documentation links |
371 | 371 | if (key === 'Getting Started' || key === 'Core Concepts' || key === 'API Reference') { |
372 | 372 | const originalHref = link.getAttribute('href'); |
373 | | - const isZh = currentLang === 'zh'; |
374 | | - |
375 | | - if (isZh && originalHref.startsWith('en/')) { |
376 | | - link.setAttribute('href', originalHref.replace('en/', 'zh/')); |
377 | | - } else if (!isZh && originalHref.startsWith('zh/')) { |
378 | | - link.setAttribute('href', originalHref.replace('zh/', 'en/')); |
| 373 | + if (originalHref) { |
| 374 | + if (currentLang === 'zh' && originalHref.startsWith('en/')) { |
| 375 | + link.setAttribute('href', originalHref.replace('en/', 'zh/')); |
| 376 | + } else if (currentLang === 'en' && originalHref.startsWith('zh/')) { |
| 377 | + link.setAttribute('href', originalHref.replace('zh/', 'en/')); |
| 378 | + } |
379 | 379 | } |
380 | 380 | } |
| 381 | + }); |
381 | 382 |
|
382 | | - // Update Hero Button Link |
383 | | - const heroBtn = document.querySelector('.btn-primary'); |
384 | | - const heroHref = heroBtn.getAttribute('href'); |
| 383 | + // Update Hero Button Link |
| 384 | + const heroBtn = document.querySelector('.btn-primary'); |
| 385 | + const heroHref = heroBtn.getAttribute('href'); |
| 386 | + if (heroHref) { |
385 | 387 | if (currentLang === 'zh' && heroHref.startsWith('en/')) { |
386 | 388 | heroBtn.setAttribute('href', heroHref.replace('en/', 'zh/')); |
387 | 389 | } else if (currentLang === 'en' && heroHref.startsWith('zh/')) { |
388 | 390 | heroBtn.setAttribute('href', heroHref.replace('zh/', 'en/')); |
389 | 391 | } |
390 | | - }); |
| 392 | + } |
391 | 393 | } |
392 | 394 | </script> |
393 | 395 | </body> |
|
0 commit comments