1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2025-05-07 21:16:00 +02:00

Use i18n to translate some strings

Hugo 0.17 allows for easy multi-lingual sites. Strings can be
translated either in the theme or in the site, and missing strings
will fall back to the default language.

See: https://github.com/spf13/hugo/blob/master/docs/content/content/multilingual.md
This commit is contained in:
2016-10-03 22:57:27 +03:00
parent d098836949
commit 577e168da5
5 changed files with 19 additions and 5 deletions

View File

@ -1,7 +1,7 @@
<aside class="col-sm-3 offset-sm-1 blog-sidebar">
{{ if isset .Site.Params.sidebar "about" }}
<section class="sidebar-module sidebar-module-inset">
<h4>About</h4>
<h4>{{ i18n "about" }}</h4>
<p>{{ .Site.Params.sidebar.about | markdownify }}</p>
</section>
{{ end }}
@ -9,7 +9,7 @@
{{ $num_recent_posts := (index .Site.Params.sidebar "num_recent_posts" | default 5) }}
<section class="sidebar-module">
<h4>Recent Posts</h4>
<h4>{{ i18n "recentPosts" }}</h4>
<ol class="list-unstyled">
{{ range first $num_recent_posts (where .Site.Pages "Type" "post") }}
<li><a href="{{.RelPermalink}}">{{.Title}}</a></li>