2020-09-13 05:22:47 -04:00
|
|
|
<section class="widget archives">
|
2020-08-22 07:20:08 -04:00
|
|
|
<div class="widget-icon">
|
|
|
|
{{ (resources.Get "icons/infinity.svg").Content | safeHTML }}
|
|
|
|
</div>
|
2020-09-13 05:22:47 -04:00
|
|
|
<h1 class="widget-title">{{ T "widgetArchivesTitle" }}</h1>
|
2020-08-22 07:20:08 -04:00
|
|
|
|
2020-09-06 07:15:38 -04:00
|
|
|
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
|
|
|
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}
|
|
|
|
{{ $filtered := ($pages | intersect $notHidden) }}
|
2020-09-13 05:22:47 -04:00
|
|
|
{{ $archives := $filtered.GroupByDate "2006" }}
|
2020-08-25 06:39:03 -04:00
|
|
|
|
2020-09-13 05:22:47 -04:00
|
|
|
{{ range first .Site.Params.widgets.archives.limit ($archives) }}
|
2020-08-22 07:20:08 -04:00
|
|
|
{{ $id := lower (replace .Key " " "-") }}
|
2020-09-13 05:22:47 -04:00
|
|
|
<div class="archives-year">
|
|
|
|
<a href="{{ $.Site.Params.widgets.archives.path | relLangURL }}#{{ $id }}">
|
2020-08-22 07:20:08 -04:00
|
|
|
<span class="year">{{ .Key }}</span>
|
|
|
|
<span class="count">{{ len .Pages }}</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
2020-08-25 06:39:03 -04:00
|
|
|
|
2020-09-13 05:22:47 -04:00
|
|
|
{{ if gt (len $archives) .Site.Params.widgets.archives.limit }}
|
|
|
|
<div class="archives-year">
|
|
|
|
<a href="{{ $.Site.Params.widgets.archives.path | relLangURL }}">
|
|
|
|
<span class="year">{{ T "widgetArchivesMore" }}</span>
|
2020-08-25 06:39:03 -04:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
2020-08-22 07:20:08 -04:00
|
|
|
</section>
|