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

@ -10,6 +10,7 @@
<div class="post-short-list h-entry">
<header class="post-header">
<h2 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}"><a class="u-url" href="{{ .RelPermalink }}">{{ trim .Title " " }}</a></h2>
{{ partial "post-language-switcher.html" . }}
</header>
{{ partial "postInfo.html" . }}
</div>

View file

@ -10,6 +10,8 @@
<article class="post h-entry">
<header class="post-header">
<h1 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}">{{ trim .Title " " }}</h1>
{{ partial "post-language-switcher.html" . }}
</header>
<div class="content e-content">
{{ .Content }}

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 }}