This repository has been archived on 2024-11-25. You can view files and clone it, but cannot push or open issues or pull requests.
m3tam3re.com/themes/FixIt/layouts/partials/recently-updated.html

26 lines
1.2 KiB
HTML
Raw Normal View History

2023-10-12 14:01:05 +02:00
{{- if and .Site.Params.section.recentlyUpdated.enable (eq $.Paginator.PageNumber 1) -}}
{{- $hasTitle := false }}
{{- $postCount := 0 -}}
{{- $maxPostCount := .Site.Params.section.recentlyUpdated.maxCount | default 10 -}}
{{- $days := .Site.Params.section.recentlyUpdated.days | default 30 -}}
{{- range first $maxPostCount (where .Data.Pages.ByLastmod.Reverse "Section" "!=" "") -}}
{{- if gt (add .Lastmod.Unix (mul 86900 $days)) now.Unix -}}
{{- if ne .Lastmod.Unix .Date.Unix }}
{{- $postCount = add $postCount 1 -}}
{{- if eq $hasTitle false -}}
<h2 class="group-title">{{- T "section.recentlyUpdated" -}}</h2>
{{- $hasTitle = true -}}
{{- end -}}
<article class="archive-item">
<a href="{{ .RelPermalink }}" class="archive-item-link">{{- .Title -}}</a>
<span class="archive-item-date" title='{{ "2006-01-02 15:04:05" | .Lastmod.Format }}'>
{{- with .Site.Params.section.dateformat | default "01-02" | .Lastmod.Format -}}
{{- dict "Date" . | T "single.updatedOnDate" -}}
{{- end -}}
</span>
</article>
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}