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 }} {{- end }}
{{- if not (.Param "hideMeta") }} {{- if not (.Param "hideMeta") }}
<div class="post-meta"> <div class="post-meta">
{{- if .IsTranslated -}} {{- partial "translation_list.html" . -}}
<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 }}
</div> </div>
{{- end}} {{- end}}
</header> </header>

View File

@ -31,24 +31,8 @@
{{- end }} {{- end }}
{{- if not (.Param "hideMeta") }} {{- if not (.Param "hideMeta") }}
<div class="post-meta"> <div class="post-meta">
{{- partial "post_meta.html" . -}} {{- partial "post_meta.html" . -}}
{{- if .IsTranslated -}} {{- partial "translation_list.html" . -}}
{{- 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 }}
</div> </div>
{{- end}} {{- end}}
</header> </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 }}