aboutsummaryrefslogtreecommitdiff
path: root/themes/hugo-theme-stack/layouts/partials/widget/archives.html
diff options
context:
space:
mode:
authorAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-11-16 19:32:18 +0300
committerAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-11-17 01:28:57 +0300
commit239d68f94c6250276850fbe95eaa6cdd5c38fb26 (patch)
treec576da169afc442f51eae6213ad0ff749ed86589 /themes/hugo-theme-stack/layouts/partials/widget/archives.html
parent8e79098193fd0a8b65305dd8054cf7c424c60bc5 (diff)
Своя тема, полностью всё переделал
Diffstat (limited to 'themes/hugo-theme-stack/layouts/partials/widget/archives.html')
-rw-r--r--themes/hugo-theme-stack/layouts/partials/widget/archives.html35
1 files changed, 0 insertions, 35 deletions
diff --git a/themes/hugo-theme-stack/layouts/partials/widget/archives.html b/themes/hugo-theme-stack/layouts/partials/widget/archives.html
deleted file mode 100644
index 1f2abc5..0000000
--- a/themes/hugo-theme-stack/layouts/partials/widget/archives.html
+++ /dev/null
@@ -1,35 +0,0 @@
-{{- $query := first 1 (where .Context.Site.Pages "Layout" "==" "archives") -}}
-{{- $context := .Context -}}
-{{- $limit := default 5 .Params.limit -}}
-{{- if $query -}}
- {{- $archivesPage := index $query 0 -}}
- <section class="widget archives">
- <div class="widget-icon">
- {{ partial "helper/icon" "infinity" }}
- </div>
- <h2 class="widget-title section-title">{{ T "widget.archives.title" }}</h2>
-
- {{ $pages := where $context.Site.RegularPages "Type" "in" $context.Site.Params.mainSections }}
- {{ $notHidden := where $context.Site.RegularPages "Params.hidden" "!=" true }}
- {{ $filtered := ($pages | intersect $notHidden) }}
- {{ $archives := $filtered.GroupByDate "2006" }}
-
- <div class="widget-archive--list">
- {{ range $index, $item := first (add $limit 1) ($archives) }}
- {{- $id := lower (replace $item.Key " " "-") -}}
- <div class="archives-year">
- <a href="{{ $archivesPage.RelPermalink }}#{{ $id }}">
- {{ if eq $index $limit }}
- <span class="year">{{ T "widget.archives.more" }}</span>
- {{ else }}
- <span class="year">{{ .Key }}</span>
- <span class="count">{{ len $item.Pages }}</span>
- {{ end }}
- </a>
- </div>
- {{ end }}
- </div>
- </section>
-{{- else -}}
- {{- warnf "Archives page not found. Create a page with layout: archives." -}}
-{{- end -}} \ No newline at end of file