show languages for posts #92
This commit is contained in:
parent
866556ffb3
commit
de6decde38
5 changed files with 54 additions and 0 deletions
|
@ -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>
|
||||
|
|
|
@ -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 }}
|
||||
|
|
16
layouts/partials/post-language-switcher.html
Normal file
16
layouts/partials/post-language-switcher.html
Normal 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 }}
|
|
@ -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 }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue