Add basic multilingual support

Multilingual support added for:
* homepage widget system
* navigation bar links
* 'more posts/publications/talks' links in widgets
This commit is contained in:
George Cushen 2017-02-13 19:51:28 +00:00
commit b99e5a1e21
5 changed files with 7 additions and 7 deletions

View file

@ -8,7 +8,7 @@
{{ range $index, $page := where .Data.Pages "Type" "home" }}
{{ $params := dict "root" $ "page" $page }}
{{ $widget := printf "widgets/%s.html" ( or $page.Params.widget "custom" ) }}
<section id="{{ $page.File.BaseFileName }}" class="home-section">
<section id="{{ $page.File.TranslationBaseName }}" class="home-section">
<div class="container">
{{ partial $widget $params }}
</div>

View file

@ -10,7 +10,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ "/" | relURL }}">{{ .Site.Title }}</a>
<a class="navbar-brand" href="{{ "/" | relLangURL }}">{{ .Site.Title }}</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
@ -29,7 +29,7 @@
<ul class="dropdown-menu">
{{ range .Children }}
<li class="nav-item">
<a href="{{ .URL | relURL }}"{{ if $.IsHome }} data-target="{{ .URL }}"{{ end }}>
<a href="{{ .URL | relLangURL }}"{{ if $.IsHome }} data-target="{{ .URL }}"{{ end }}>
{{ .Pre }}
<span>{{ .Name }}</span>
</a>
@ -41,7 +41,7 @@
{{ else }}
<li class="nav-item">
<a href="{{ .URL | relURL }}"{{ if $.IsHome }} data-target="{{ .URL }}"{{ end }}>
<a href="{{ .URL | relLangURL }}"{{ if $.IsHome }} data-target="{{ .URL }}"{{ end }}>
{{ .Pre }}
<span>{{ .Name }}</span>
</a>

View file

@ -10,7 +10,7 @@
{{ with $page.Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
{{ if gt $posts_len $page.Params.count }}
<p class="view-all">
<a href="{{ "/post/" | relURL }}">
<a href="{{ "/post/" | relLangURL }}">
{{ i18n "more_posts" | markdownify }}
<i class="fa fa-angle-double-right"></i>
</a>

View file

@ -9,7 +9,7 @@
{{ with $page.Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
{{ if gt $pubs_len $page.Params.count }}
<p class="view-all">
<a href="{{ $.Site.BaseURL }}publication/">
<a href="{{ "/publication/" | relLangURL }}">
{{ i18n "more_publications" | markdownify }}
<i class="fa fa-angle-double-right"></i>
</a>

View file

@ -9,7 +9,7 @@
{{ with $page.Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
{{ if gt $talks_len $page.Params.count }}
<p class="view-all">
<a href="{{ $.Site.BaseURL }}talk/">
<a href="{{ "/talk/" | relLangURL }}">
{{ i18n "more_talks" | markdownify }}
<i class="fa fa-angle-double-right"></i>
</a>