post-single : display available translations

in post - meta
This commit is contained in:
Aditya Telange 2020-09-22 13:41:23 +05:30
parent ae2436cc5a
commit 5901cac6c4
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77
2 changed files with 19 additions and 0 deletions

View File

@ -13,6 +13,15 @@
.post-meta { .post-meta {
color: var(--secondary); color: var(--secondary);
font-size: 14px; font-size: 14px;
display: flex;
flex-wrap: wrap;
}
.post-meta .i18n_list li {
display: inline-flex;
list-style: none;
margin: auto 3px;
box-shadow: 0 1px 0 var(--secondary);
} }
.post-content { .post-content {

View File

@ -13,6 +13,16 @@
{{ $default_txt := print .ReadingTime " " "min" }} {{ $default_txt := print .ReadingTime " " "min" }}
{{ i18n "read_time" .ReadingTime | default $default_txt }}{{ end }} {{ i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
{{ if or .Params.author .Site.Params.author }} . {{ .Params.author | default .Site.Params.author }}{{ end }} {{ if or .Params.author .Site.Params.author }} . {{ .Params.author | default .Site.Params.author }}{{ end }}
{{ if .IsTranslated -}}|
<ul class="i18n_list">
{{ i18n "translations" | default "Translations"}}:
{{ range .Translations }}
<li>
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
</li>
{{ end }}
</ul>
{{ end }}
</div> </div>
{{end}} {{end}}
</header> </header>