Add OnlyTranslated property (#303)

* Add OnlyTranslated property

Signed-off-by: Alex Ivanov <ai@contributor.pw>

* Add newlines

Signed-off-by: Alex Ivanov <ai@contributor.pw>

* rename property

Signed-off-by: Alex Ivanov <ai@contributor.pw>
This commit is contained in:
Alex Ivanov
2021-01-21 13:42:26 +03:00
committed by GitHub
parent e53a638b2c
commit c828c6660f
3 changed files with 13 additions and 2 deletions
+5 -2
View File
@@ -1,7 +1,10 @@
<!-- Merge home and current page translations -->
{{ $bookTranslatedOnly := default false .Site.Params.BookTranslatedOnly }}
{{ $translations := dict }}
{{ range .Site.Home.AllTranslations }}
{{ $translations = merge $translations (dict .Language.Lang .) }}
{{ if (eq $bookTranslatedOnly false ) }}
{{ range .Site.Home.AllTranslations }}
{{ $translations = merge $translations (dict .Language.Lang .) }}
{{ end }}
{{ end }}
{{ range .Translations }}
{{ $translations = merge $translations (dict .Language.Lang .) }}