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
other: Subsections
categories:
other: Categories
tags:
other: Tags
article:
back:
other: Back

View file

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

View file

@ -4,14 +4,27 @@
{{ if eq .Parent (.GetPage "/") }}
{{ T "list.section" }}
{{ else }}
{{ .Parent.Title }}
{{ T (printf "list.%s" .Parent.Title | urlize | lower) }}
{{ end }}
</h3>
<div class="section-card">
<div class="section-details">
<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 }}
<h2 class="section-description">{{ . }}</h2>
{{ end }}

View file

@ -1,12 +1,22 @@
<article>
<a href="{{ .RelPermalink }}">
<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">
{{- .Title -}}
{{- $title -}}
</h2>
<footer class="article-time">
<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>
</footer>
</div>