From 7a505a9954ff1515058a3d51b7b9f35e81c327fe Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Thu, 6 Nov 2025 08:46:11 +0900 Subject: modified recordings/recordings-plain.html --- layouts/recordings/recordings-plain.html | 140 +++++++++++++++++++++---------- 1 file changed, 98 insertions(+), 42 deletions(-) diff --git a/layouts/recordings/recordings-plain.html b/layouts/recordings/recordings-plain.html index 590f44c..006f2d5 100644 --- a/layouts/recordings/recordings-plain.html +++ b/layouts/recordings/recordings-plain.html @@ -195,51 +195,107 @@ {{ end }} - + + {{ $nowMonth := now.Format "2006-01" }} + {{ $.Scratch.Set "monthKeys" (slice) }} + {{ $.Scratch.Set "monthSeen" (dict) }} {{ range $p := .Pages.ByDate.Reverse }} - {{ if eq $p.File.BaseFileName "whoareyou" }}{{ continue }}{{ end }} - {{ $vid := $p.Resources.GetMatch "*.{mp4,mov}" }} - {{ $img := $p.Resources.GetMatch "*.{jpg,jpeg,png,gif,webp,svg}" }} - {{ $heic := $p.Resources.GetMatch "*.{heic,HEIC}" }} - {{ $folderBase := path.Base $p.File.Dir }} - {{ $dateKey := $p.Date.Format "2006-01-02" }} -
  • - {{ if $vid }} - - {{ with $p.Title }}{{ . }}{{ else }}{{ $vid.Name }}{{ end }} - - video - {{ $d := $p.Date.Format "2006-01-02" }}{{ if ne $d "0001-01-01" }}
    {{ $d }}
    {{ end }} - {{ else if $img }} - - {{ with $p.Title }}{{ . }}{{ else }}{{ $img.Name }}{{ end }} - - image - {{ $d := $p.Date.Format "2006-01-02" }}{{ if ne $d "0001-01-01" }}
    {{ $d }}
    {{ end }} - {{ else if $heic }} - - {{ with $p.Title }}{{ . }}{{ else }}{{ $heic.Name }}{{ end }} - - heic - {{ $d := $p.Date.Format "2006-01-02" }}{{ if ne $d "0001-01-01" }}
    {{ $d }}
    {{ end }} + {{ if eq $p.File.BaseFileName "whoareyou" }}{{ continue }}{{ end }} + {{ $dstr := $p.Date.Format "2006-01-02" }} + {{ $m := cond (eq $dstr "0001-01-01") "etc" ($p.Date.Format "2006-01") }} + {{ $seen := $.Scratch.Get "monthSeen" }} + {{ if not (index $seen $m) }} + {{ $.Scratch.Set "monthSeen" (merge $seen (dict $m true)) }} + {{ $.Scratch.Add "monthKeys" (slice $m) }} + {{ end }} + {{ $key := printf "month_%s" $m }} + {{ if $.Scratch.Get $key }} + {{ $.Scratch.Add $key (slice $p) }} {{ else }} - {{ $d := $p.Date.Format "2006-01-02" }} - {{ if ne $d "0001-01-01" }}{{ $d }} {{ end }}{{ $p.Title }} - note + {{ $.Scratch.Set $key (slice $p) }} + {{ end }} + {{ end }} + + {{ $monthKeys := $.Scratch.Get "monthKeys" }} + + {{ range $m := $monthKeys }} + {{ $key := printf "month_%s" $m }} + {{ $pages := $.Scratch.Get $key }} + {{ if eq $m $nowMonth }} + {{ range $p := $pages }} + {{ $vid := $p.Resources.GetMatch "*.{mp4,mov}" }} + {{ $img := $p.Resources.GetMatch "*.{jpg,jpeg,png,gif,webp,svg}" }} + {{ $heic := $p.Resources.GetMatch "*.{heic,HEIC}" }} + {{ $folderBase := path.Base $p.File.Dir }} + {{ $dateKey := $p.Date.Format "2006-01-02" }} +
  • + {{ if $vid }} + + {{ with $p.Title }}{{ . }}{{ else }}{{ $vid.Name }}{{ end }} + + video + {{ $d := $p.Date.Format "2006-01-02" }}{{ if ne $d "0001-01-01" }}
    {{ $d }}
    {{ end }} + {{ else if $img }} + + {{ with $p.Title }}{{ . }}{{ else }}{{ $img.Name }}{{ end }} + + image + {{ $d := $p.Date.Format "2006-01-02" }}{{ if ne $d "0001-01-01" }}
    {{ $d }}
    {{ end }} + {{ else if $heic }} + + {{ with $p.Title }}{{ . }}{{ else }}{{ $heic.Name }}{{ end }} + + heic + {{ $d := $p.Date.Format "2006-01-02" }}{{ if ne $d "0001-01-01" }}
    {{ $d }}
    {{ end }} + {{ else }} + {{ $d := $p.Date.Format "2006-01-02" }} + {{ if ne $d "0001-01-01" }}{{ $d }} {{ end }}{{ $p.Title }} + note + {{ end }} +
  • + {{ end }} + {{ else }} +
  • +
    + + {{ $m }}/ + ({{ len $pages }} items) + + +
    +
  • {{ end }} - {{ end }} {{ if and (eq (len $secVids) 0) (eq (len .Pages) 0) }} -- cgit v1.2.3