Skip to content

Commit

Permalink
feat: language menus now generated by page links instead of home link
Browse files Browse the repository at this point in the history
  • Loading branch information
tomowang committed Mar 21, 2024
1 parent c180809 commit 99a9181
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions assets/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -1356,6 +1356,10 @@ video {
cursor: pointer;
}

.cursor-default {
cursor: default;
}

.flex-row {
flex-direction: row;
}
Expand Down
7 changes: 6 additions & 1 deletion layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@
</button>
<div class="absolute hidden top-16 z-50" id="navbar-lang">
<ul class="flex flex-col rounded-sm px-3 text-base font-medium text-slate-800 dark:text-slate-200 shadow-lg bg-white dark:bg-gray-600 shadow-slate-800/5 dark:shadow-slate-200/5 ring-1 ring-slate-900/5 dark:ring-slate-100/5">
{{ range .Site.Home.AllTranslations.ByWeight }}
{{- $page := . -}}
{{ range .AllTranslations }}
<li class="">
{{- if (ne $page.Language.LanguageCode .Language.LanguageCode) }}
<a class="block px-3 py-3 hover:text-emerald-600"
href="{{ .RelPermalink }}" title="{{ .Language.LanguageName }}">{{ .Language.LanguageName }}</a>
{{- else }}
<span class="block px-3 py-3 cursor-default hover:text-emerald-600">{{ .Language.LanguageName }}</span>
{{ end -}}
</li>
{{ end }}
</ul>
Expand Down

0 comments on commit 99a9181

Please sign in to comment.