|
1 | 1 | <header class="nav flex flex-row row py-2 mb-6 w-full border-b border-gray-300 dark:border-gray-700 justify-between">
|
2 | 2 | <div>
|
3 |
| - <a class="no-underline p-2 rounded hover:bg-gray-200 dark:hover:bg-gray-800" href="{{ .Site.BaseURL }}">Home</a> |
4 |
| - <a class="no-underline p-2 rounded hover:bg-gray-200 dark:hover:bg-gray-800" |
5 |
| - href="{{ `publication-list` | relURL }}">Publications</a> |
6 |
| - {{/* <a class="no-underline p-2 rounded hover:bg-gray-200 dark:hover:bg-gray-800" |
7 |
| - href="{{ `blog` | relURL }}">Blog</a> */}} |
| 3 | + <a class='no-underline p-2 rounded hover:bg-gray-200 dark:hover:bg-gray-800' href='{{ "/" | relLangURL }}'>Home</a> |
| 4 | + <a class="no-underline p-2 rounded hover:bg-gray-200 dark:hover:bg-gray-800" href='{{ "publication-list" | |
| 5 | + relLangURL }}'>Publications</a> |
8 | 6 | </div>
|
9 | 7 | <div>
|
10 |
| - <a class="mr-4" href="{{ `search` | relURL }}"><i class="fas fa-search"></i></i></a> |
| 8 | + <a class="mr-4" href='{{ "search" | relLangURL }}'><i class="fas fa-search"></i></a> |
11 | 9 | <i class="fas fa-sun theme-toggle text-blue-500 hover:text-blue-700 dark:text-yellow-300 dark:hover:text-yellow-500 cursor-pointer text-lg mr-9 sm:mr-0"
|
12 | 10 | onclick="lightDark(this)"></i>
|
13 | 11 | <a class="no-underline p-2 rounded hover:bg-gray-200 dark:hover:bg-gray-800 cursor-pointer"
|
|
17 | 15 |
|
18 | 16 | <script>
|
19 | 17 | const lightDark = (el) => {
|
20 |
| - let html = document.querySelector("html"); |
| 18 | + const html = document.querySelector("html"); |
21 | 19 | if (html.classList.contains("dark")) {
|
22 | 20 | html.classList.remove("dark");
|
23 | 21 | el.classList.add("fa-moon");
|
|
40 | 38 | const currentLanguage = getCurrentLanguage();
|
41 | 39 |
|
42 | 40 | if (currentLanguage === "ja") {
|
43 |
| - // Remove "/ja" from the path to redirect to the English page |
44 | 41 | basePath = basePath.replace(/^\/ja/, "");
|
45 | 42 | } else {
|
46 |
| - // Add "/ja" to the path to redirect to the Japanese page |
| 43 | + basePath = basePath.replace(/^\/en/, ""); |
47 | 44 | basePath = "/ja" + basePath;
|
48 | 45 | }
|
49 |
| - |
50 | 46 | window.location.href = basePath;
|
51 | 47 | }
|
52 | 48 |
|
|
0 commit comments