Merge pull request #34 from memclutter/set-abs-lang-url

Added support for i18n url in main menu
This commit is contained in:
x 2022-11-06 12:22:56 +08:00 committed by GitHub
commit 10dcb7a324
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -5,7 +5,7 @@
{{ $data := .Data }} {{ $data := .Data }}
{{ range $key, $value := .Data.Terms.ByCount }} {{ range $key, $value := .Data.Terms.ByCount }}
<div class="mb-5 flex justify-between"> <div class="mb-5 flex justify-between">
<a class="self-start" href="/{{ $data.Plural }}/{{ $value.Name }}"> <a class="self-start" href="{{ $data.Plural | absLangURL }}/{{ $value.Name }}">
{{ $value.Name }} {{ $value.Name }}
</a> </a>
<span class="">{{ $value.Count }}</span> <span class="">{{ $value.Count }}</span>

View file

@ -8,7 +8,7 @@
<nav class="flex items-center <nav class="flex items-center
whitespace-nowrap overflow-x-auto overflow-y-hidden"> whitespace-nowrap overflow-x-auto overflow-y-hidden">
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
<a class="ml-5" href="{{ .URL }}">{{ .Name }}</a> <a class="ml-5" href="{{ .URL | absLangURL }}">{{ .Name }}</a>
{{ end }} {{ end }}
</nav> </nav>
</header> </header>