feat(archive widget): improve "more" link
Link it to the next available year
This commit is contained in:
parent
75f5c209e1
commit
9d76ab371f
@ -9,20 +9,16 @@
|
|||||||
{{ $filtered := ($pages | intersect $notHidden) }}
|
{{ $filtered := ($pages | intersect $notHidden) }}
|
||||||
{{ $archives := $filtered.GroupByDate "2006" }}
|
{{ $archives := $filtered.GroupByDate "2006" }}
|
||||||
|
|
||||||
{{ range first .Site.Params.widgets.archives.limit ($archives) }}
|
{{ range $index, $item := first (add .Site.Params.widgets.archives.limit 1) ($archives) }}
|
||||||
{{ $id := lower (replace .Key " " "-") }}
|
{{- $id := lower (replace $item.Key " " "-") -}}
|
||||||
<div class="archives-year">
|
<div class="archives-year">
|
||||||
<a href="{{ $.Site.Params.widgets.archives.path | relLangURL }}#{{ $id }}">
|
<a href="{{ $.Site.Params.widgets.archives.path | relLangURL }}#{{ $id }}">
|
||||||
<span class="year">{{ .Key }}</span>
|
{{ if eq $index $.Site.Params.widgets.archives.limit }}
|
||||||
<span class="count">{{ len .Pages }}</span>
|
<span class="year">{{ T "widgetArchivesMore" }}</span>
|
||||||
</a>
|
{{ else }}
|
||||||
</div>
|
<span class="year">{{ .Key }}</span>
|
||||||
{{ end }}
|
<span class="count">{{ len $item.Pages }}</span>
|
||||||
|
{{ end }}
|
||||||
{{ 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>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user