More translation work.

- Add a language selection menu selection in the gear menu.

- Fix the Blog link in the top nav to use the proper trsanslated term and target page.
This commit is contained in:
mtail 2018-06-13 23:30:40 -07:00
parent 94ff6c9c44
commit 76d6469251
5 changed files with 13 additions and 6 deletions

View File

@ -13,7 +13,7 @@
<link>{{ $home }}</link>
</image>
{{ $pages := (where .Site.AllPages "Section" "blog").ByPublishDate }}
{{ $pages := (where .Site.Pages "Section" "blog").ByPublishDate }}
{{ range $post := $pages }}
{{ if and (not $post.Draft) $post.IsPage }}

View File

@ -1,4 +1,4 @@
{{ $posts := (where .Site.AllPages "Section" "blog").ByPublishDate.Reverse }}
{{ $posts := (where .Site.Pages "Section" "blog").ByPublishDate.Reverse }}
{{ $latest_post := index $posts 0 }}
{{ $version := .Site.Data.args.version }}
@ -6,7 +6,9 @@
<header>
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark justify-content-between">
<a class="navbar-brand" href="/">
{{ $home := .Site.GetPage "home" }}
<a class="navbar-brand" href="{{ $home.Permalink }}">
<span class="logo">{{ partial "icons/istio-logo-blue-background-round.svg" }}</span>
{{ if .Site.Data.args.archive }}
@ -64,6 +66,11 @@
<div class="dropdown-divider"></div>
<a href="/" class="dropdown-item {{ if eq $home.Lang "en" }}active{{ end }}">English</a>
<a href="/cn" class="dropdown-item {{ if eq $home.Lang "cn" }}active{{ end }}">中文</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="light-theme-item" href="" onclick="setActiveStyleSheet('light');return false;">{{ i18n "light_theme" }}</a>
<a class="dropdown-item" id="dark-theme-item" href="" onclick="setActiveStyleSheet('dark');return false;">{{ i18n "dark_theme" }}</a>

View File

@ -3,7 +3,7 @@
<div class="directory" role="tablist">
{{ $section := .Site.GetPage "section" .Section }}
{{ $pages := (where .Site.AllPages "Section" .Section).ByWeight }}
{{ $pages := (where .Site.Pages "Section" .Section).ByWeight }}
{{ $current := . }}
{{ range $count, $page := $pages }}

View File

@ -10,7 +10,7 @@
</div>
</div>
{{ $pages := (where .Site.AllPages "Section" .Section).ByWeight }}
{{ $pages := (where .Site.Pages "Section" .Section).ByWeight }}
<div role="tabpanel" aria-labelledby="header0">
<div class="card-body">

View File

@ -5,7 +5,7 @@
<p>{{ .Description }}</p>
<div class="section-index">
{{ $pages := (where .Site.AllPages "Section" .Section).ByWeight }}
{{ $pages := (where .Site.Pages "Section" .Section).ByWeight }}
{{ partial "section-index-level.html" (dict "pages" $pages "parent" . ) }}
</div>