mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2023-12-21 10:22:58 +01:00
Merge 8bcc8379ed
into 0989c28a0e
This commit is contained in:
commit
0e92a1e292
@ -38,7 +38,7 @@
|
|||||||
- Social Icons (home-info and profile-mode)
|
- Social Icons (home-info and profile-mode)
|
||||||
- Social-Media Share buttons on posts.
|
- Social-Media Share buttons on posts.
|
||||||
- Menu location indicator.
|
- Menu location indicator.
|
||||||
- Multilingual support. (with language selector)
|
- Multilingual support (with improved language selector)
|
||||||
- Taxonomies
|
- Taxonomies
|
||||||
- Cover image for each post (with Responsive image support).
|
- Cover image for each post (with Responsive image support).
|
||||||
- Light/Dark theme (automatic theme switch a/c to browser theme and theme-switch button).
|
- Light/Dark theme (automatic theme switch a/c to browser theme and theme-switch button).
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
{{ .Description }}
|
{{ .Description }}
|
||||||
</div>
|
</div>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if not (.Param "hideMeta") }}
|
{{- if and (.Param "showTranslationListInPosts") (not (.Param "hideMeta")) }}
|
||||||
<div class="post-meta">
|
<div class="post-meta">
|
||||||
{{- partial "translation_list.html" . -}}
|
{{- partial "translation_list.html" . -}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,7 +22,9 @@
|
|||||||
{{- 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 .Param "showTranslationListInPosts" }}
|
||||||
{{- partial "translation_list.html" . -}}
|
{{- partial "translation_list.html" . -}}
|
||||||
|
{{- end }}
|
||||||
{{- partial "edit_post.html" . -}}
|
{{- partial "edit_post.html" . -}}
|
||||||
{{- partial "post_canonical.html" . -}}
|
{{- partial "post_canonical.html" . -}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -96,27 +96,42 @@
|
|||||||
</button>
|
</button>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- $lang := .Lang}}
|
{{/* LANGUAGE SELECTOR */}}
|
||||||
{{- $separator := or $label_text (not site.Params.disableThemeToggle)}}
|
{{ if .Site.IsMultiLingual }}
|
||||||
{{- with site.Home.AllTranslations }}
|
{{/* set vars with page data */}}
|
||||||
|
{{ $currentLang := .Lang }}
|
||||||
|
{{ $allTranslations := .Translations }}
|
||||||
|
|
||||||
|
{{ $separator := or $label_text (not site.Params.disableThemeToggle)}}
|
||||||
|
|
||||||
<ul class="lang-switch">
|
<ul class="lang-switch">
|
||||||
{{- if $separator }}<li>|</li>{{ end }}
|
{{ if $separator }}<li>|</li>{{ end }}
|
||||||
{{- range . -}}
|
{{ range $anySiteLang := .Site.Home.AllTranslations }}
|
||||||
{{- if ne $lang .Lang }}
|
|
||||||
|
{{/* code here can only access page-related data via vars set above */}}
|
||||||
|
{{ if ne $currentLang $anySiteLang.Lang }}
|
||||||
|
{{ $translationLink := .Permalink }}
|
||||||
|
{{ range $translation := $allTranslations }}
|
||||||
|
{{ if eq $anySiteLang.Lang $translation.Lang }}
|
||||||
|
{{ $translationLink = $translation.Permalink }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a href="{{- .Permalink -}}" title="{{ .Language.Params.languageAltTitle | default (.Language.LanguageName | emojify) | default (.Lang | title) }}"
|
<a href="{{ $translationLink }}"
|
||||||
aria-label="{{ .Language.LanguageName | default (.Lang | title) }}">
|
title="{{ .Language.Params.languageAltTitle | default (.Language.LanguageName ) | default (.Lang | upper) }}"
|
||||||
{{- if (and site.Params.displayFullLangName (.Language.LanguageName)) }}
|
aria-label="{{ .Language.LanguageName | default (.Lang | upper) }}">
|
||||||
{{- .Language.LanguageName | emojify -}}
|
{{ if site.Params.DisplayFullLangName }}
|
||||||
{{- else }}
|
{{ .Language.LanguageName }}
|
||||||
{{- .Lang | title -}}
|
{{ else }}
|
||||||
{{- end -}}
|
{{ .Lang | upper }}
|
||||||
|
{{ end }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{{- end -}}
|
{{ end }}
|
||||||
{{- end}}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{- end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{- $currentPage := . }}
|
{{- $currentPage := . }}
|
||||||
|
Loading…
Reference in New Issue
Block a user