27
0
Fork 1
forked from mirror/Mainroad

implement multilang

This commit is contained in:
dark_hash 2025-01-21 18:00:16 +01:00 committed by Xiretza
parent 0365a26f4a
commit e1ff8c0f8c
3 changed files with 7 additions and 3 deletions

View file

@ -6,7 +6,11 @@
</div>
{{- end }}
{{ $paginator := (.Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections).ByDate.Reverse (.Site.Params.pagerSizeIndex | default 5))}}
{{ $pages := .Site.RegularPages }}
{{ range .Site.Home.Translations }}
{{ $pages = $pages | lang.Merge .Site.RegularPages }}
{{ end }}
{{ $paginator := (.Paginate (where $pages "Type" "in" .Site.Params.mainSections).ByDate.Reverse (.Site.Params.pagerSizeIndex | default 5))}}
{{ range $paginator.Pages }}
{{- .Render "summary" }}
{{ end }}

View file

@ -2,7 +2,7 @@
<div class="footer__links">
{{ range $key, $value := . }}
{{- if ne $key 0 }} | {{ end -}}
<a class="footer__link" href="{{ $value.URL }}" {{- if not .Page }} target="_blank"{{ end }}>{{ $value.Name }}</a>
<a class="footer__link" href="{{ $value.URL }}" {{- if not .Page }} target="_blank"{{ end }}>{{ i18n $value.Identifier | default $value.Name}}</a>
{{- end }}
</div>
{{- end }}

View file

@ -12,7 +12,7 @@
{{ if .Pre }}
{{ readFile (printf "static%s" .Pre) | safeHTML }}
{{ end }}
<span class="menu__text">{{ .Name }}</span>
<span class="menu__text">{{ i18n .Identifier | default .Name}}</span>
{{ .Post }}
</a>
</li>