translation list separate partial

This commit is contained in:
Aditya Telange 2021-02-06 23:50:19 +05:30
parent 084498558c
commit 7170eda172
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77
3 changed files with 22 additions and 34 deletions

View File

@ -15,22 +15,7 @@
{{- end }}
{{- if not (.Param "hideMeta") }}
<div class="post-meta">
{{- if .IsTranslated -}}
<ul class="i18n_list">
{{- i18n "translations" | default "Translations"}}:
{{- range .Translations }}
<li>
<a href="{{ .Permalink }}">
{{- if (and $.Site.Params.displayFullLangName (.Language.LanguageName)) }}
{{- .Language.LanguageName | emojify | humanize -}}
{{- else }}
{{- .Lang | humanize -}}
{{- end -}}
</a>
</li>
{{- end }}
</ul>
{{- end }}
{{- partial "translation_list.html" . -}}
</div>
{{- end}}
</header>

View File

@ -32,23 +32,7 @@
{{- if not (.Param "hideMeta") }}
<div class="post-meta">
{{- partial "post_meta.html" . -}}
{{- if .IsTranslated -}}
{{- if or .Params.author $.Site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) }}&nbsp;|&nbsp;{{- end -}}
<ul class="i18n_list">
{{- i18n "translations" | default "Translations"}}:
{{- range .Translations }}
<li>
<a href="{{ .Permalink }}">
{{- if (and $.Site.Params.displayFullLangName (.Language.LanguageName)) }}
{{- .Language.LanguageName | emojify | humanize -}}
{{- else }}
{{- .Lang | humanize -}}
{{- end -}}
</a>
</li>
{{- end }}
</ul>
{{- end }}
{{- partial "translation_list.html" . -}}
</div>
{{- end}}
</header>

View File

@ -0,0 +1,19 @@
{{- if .IsTranslated -}}
{{- if (ne .Layout "search")}}
{{- if or .Params.author $.Site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) }}&nbsp;|&nbsp;{{- end -}}
{{- end }}
<ul class="i18n_list">
{{- i18n "translations" | default "Translations"}}:
{{- range .Translations }}
<li>
<a href="{{ .Permalink }}">
{{- if (and $.Site.Params.displayFullLangName (.Language.LanguageName)) }}
{{- .Language.LanguageName | emojify | humanize -}}
{{- else }}
{{- .Lang | humanize -}}
{{- end -}}
</a>
</li>
{{- end }}
</ul>
{{- end }}