show languages for posts #92

This commit is contained in:
Dmitry Kolosov 2021-07-08 23:32:45 +03:00
parent 866556ffb3
commit de6decde38
5 changed files with 54 additions and 0 deletions

View file

@ -0,0 +1,16 @@
{{ if .IsTranslated }}
{{ $pageLang := .Page.Lang}}
<ul class="post-translations">
{{ range .AllTranslations }}
{{ if eq .Lang $pageLang }}
<li>
{{ upper .Lang }}
</li>
{{ else }}
<li>
<a href="{{ .Permalink }}">{{ upper .Lang }}</a>
</li>
{{ end }}
{{ end }}
</ul>
{{ end }}

View file

@ -1,6 +1,7 @@
<article class="post-list h-feed">
<header class="post-header">
<h1 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}"><a class="u-url" href="{{ .RelPermalink }}">{{ trim .Title " " }}</a></h1>
{{ partial "post-language-switcher.html" . }}
</header>
{{ if not .Site.Params.disableSummary }}