fix tag translation

This commit is contained in:
Buliway 2024-07-11 15:48:52 +03:00
parent 1a6d1ad114
commit 67b8ac5516
4 changed files with 39 additions and 4 deletions

View file

@ -16,6 +16,12 @@ list:
one: Subsection one: Subsection
other: Subsections other: Subsections
categories:
other: Categories
tags:
other: Tags
article: article:
back: back:
other: Back other: Back

View file

@ -20,6 +20,12 @@ list:
many: Подразделы many: Подразделы
other: Подразделы other: Подразделы
categories:
other: Категории
tags:
other: Теги
article: article:
back: back:
other: Назад other: Назад

View file

@ -4,14 +4,27 @@
{{ if eq .Parent (.GetPage "/") }} {{ if eq .Parent (.GetPage "/") }}
{{ T "list.section" }} {{ T "list.section" }}
{{ else }} {{ else }}
{{ .Parent.Title }} {{ T (printf "list.%s" .Parent.Title | urlize | lower) }}
{{ end }} {{ end }}
</h3> </h3>
<div class="section-card"> <div class="section-card">
<div class="section-details"> <div class="section-details">
<h3 class="section-count">{{ T "list.page" (len .Pages) }}</h3> <h3 class="section-count">{{ T "list.page" (len .Pages) }}</h3>
<h1 class="section-term">{{ .Title }}</h1>
{{- $title := lower .Title -}}
{{- $section := lower .Section -}}
{{- if eq $title $section -}}
{{- $title = T (printf "list.%s" .Title | urlize | lower) -}}
{{- else if eq $section "tags" -}}
{{- $title = T (printf "tags.%s" .Title | urlize | lower) -}}
{{- else -}}
{{- $title = .Title -}}
{{- end -}}
<h1 class="section-term">{{ $title }}</h1>
{{ with .Params.description }} {{ with .Params.description }}
<h2 class="section-description">{{ . }}</h2> <h2 class="section-description">{{ . }}</h2>
{{ end }} {{ end }}

View file

@ -1,12 +1,22 @@
<article> <article>
<a href="{{ .RelPermalink }}"> <a href="{{ .RelPermalink }}">
<div class="article-details"> <div class="article-details">
{{- $title := lower .Title -}}
{{- $section := lower .Section -}}
{{- if eq $section "tags" -}}
{{- $title = T (printf "tags.%s" .Title | urlize | lower) -}}
{{- else -}}
{{- $title = .Title -}}
{{- end -}}
<h2 class="article-title"> <h2 class="article-title">
{{- .Title -}} {{- $title -}}
</h2> </h2>
<footer class="article-time"> <footer class="article-time">
<time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'> <time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
{{- .Date.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}} {{- time.Format "2 January 2006" .Date -}}
</time> </time>
</footer> </footer>
</div> </div>