2020-08-22 07:20:08 -04:00
|
|
|
<section class="widget archive">
|
|
|
|
<div class="widget-icon">
|
|
|
|
{{ (resources.Get "icons/infinity.svg").Content | safeHTML }}
|
|
|
|
</div>
|
2020-09-09 11:17:09 -04:00
|
|
|
<h1 class="widget-title">{{ T "widgetArchiveTitle" }}</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-08-25 06:39:03 -04:00
|
|
|
{{ $archive := $filtered.GroupByDate "2006" }}
|
|
|
|
|
|
|
|
{{ range first .Site.Params.widgets.archive.limit ($archive) }}
|
2020-08-22 07:20:08 -04:00
|
|
|
{{ $id := lower (replace .Key " " "-") }}
|
|
|
|
<div class="archive-year">
|
2020-09-13 04:14:17 -04:00
|
|
|
<a href="{{ $.Site.Params.widgets.archive.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
|
|
|
|
|
|
|
{{ if gt (len $archive) .Site.Params.widgets.archive.limit }}
|
|
|
|
<div class="archive-year">
|
2020-09-13 04:14:17 -04:00
|
|
|
<a href="{{ $.Site.Params.widgets.archive.path | relLangURL }}">
|
2020-09-09 11:17:09 -04:00
|
|
|
<span class="year">{{ T "widgetArchiveMore" }}</span>
|
2020-08-25 06:39:03 -04:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
2020-08-22 07:20:08 -04:00
|
|
|
</section>
|