Implemented i18n support for theme strings like Home and Search.
This commit is contained in:
parent
5515bae2cc
commit
cd457d7bcd
4 changed files with 40 additions and 6 deletions
|
|
@ -4,7 +4,7 @@
|
|||
<nav class="main-menu" role="navigation">
|
||||
<h2 class="visually-hidden">Main menu</h2>
|
||||
<ul class="navbar clearfix">
|
||||
<li><a class="{{ if .IsHome }}active{{ end }}" href="/">Home</a></li>
|
||||
<li><a class="{{ if .IsHome }}active{{ end }}" href="/">{{ i18n "menu_home" }}</a></li>
|
||||
{{ range after 1 (where .Site.Pages "Section" "") -}}
|
||||
<li><a class="{{ if eq $currentID .UniqueID }}active{{ end }}" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{ end -}}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) -}}
|
||||
<nav class="pager">
|
||||
{{ if .Paginator.HasPrev -}}
|
||||
<a href="{{ .Paginator.Prev.URL }}" rel="prev" class="pager-item pager-prev">Prev</a>
|
||||
<a href="{{ .Paginator.Prev.URL }}" rel="prev" class="pager-item pager-prev">{{ i18n "pager_prev" }}</a>
|
||||
{{ end -}}
|
||||
|
||||
{{ if .Paginator.HasNext -}}
|
||||
<a href="{{ .Paginator.Next.URL }}" rel="next" class="pager-item pager-next">Next</a>
|
||||
<a href="{{ .Paginator.Next.URL }}" rel="next" class="pager-item pager-next">{{ i18n "pager_next" }}</a>
|
||||
{{ end -}}
|
||||
</nav>
|
||||
{{ end -}}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{{ $domain := .Site.BaseURL | replaceRE "^https?://(www\\.)?([^/]+)/?" "$2" }}
|
||||
<form class="search-form" method="get" action="https://duckduckgo.com/">
|
||||
<input type="search" name="q" class="search-text" placeholder="Search" title="Enter the terms you wish to search for." size="{{ $.Param "searchSize" | default "20" }}" maxlength="128">
|
||||
<input type="search" name="q" class="search-text" placeholder="{{ i18n "search_placeholder" }}" title="{{ i18n "search_title" }}" size="{{ $.Param "searchSize" | default "20" }}" maxlength="128">
|
||||
<input type="hidden" name="sites" value="{{ $domain }}">
|
||||
<input type="submit" value="DuckDuckGo Search" class="hidden">
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<div class="tags">
|
||||
Tags:
|
||||
{{ i18n "taxo_tags" }}:
|
||||
<ul>
|
||||
{{ range .Params.tags -}}
|
||||
<li><a href="{{ "/tags/" | relURL }}{{ . | urlize }}">{{ . }}</a></li>
|
||||
|
|
|
|||
Loading…
Reference in a new issue