mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 03:00:50 +02:00
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:
parent
9709a92c4b
commit
b99e5a1e21
5 changed files with 7 additions and 7 deletions
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue