summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-11-06 08:46:11 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-11-06 08:46:11 +0900
commit7a505a9954ff1515058a3d51b7b9f35e81c327fe (patch)
treec153ce87d640e7124ad52349e0cc49f31a7fcfde
parentacde3f18aad0b59c4740cd7d36ed667b10ee55ff (diff)
modified recordings/recordings-plain.html
-rw-r--r--layouts/recordings/recordings-plain.html140
1 files 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 @@
</li>
{{ end }}
- <!-- 2) 자식 페이지들 (노트/동영상 페이지) -->
+ <!-- 2) 자식 페이지들 (노트/동영상 페이지) - 월별 그룹: 현재 달은 평면, 과거 달은 접기 -->
+ {{ $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" }}
- <li data-date="{{ $dateKey }}" data-folder="{{ $folderBase }}">
- {{ if $vid }}
- <a
- href="{{ $vid.RelPermalink }}"
- data-name="{{ or $p.Title $vid.Name }}"
- class="vid"
- >
- {{ with $p.Title }}{{ . }}{{ else }}{{ $vid.Name }}{{ end }}
- </a>
- <span class="badge">video</span>
- {{ $d := $p.Date.Format "2006-01-02" }}{{ if ne $d "0001-01-01" }}<div class="meta">{{ $d }}</div>{{ end }}
- {{ else if $img }}
- <a
- href="{{ $img.RelPermalink }}"
- data-name="{{ or $p.Title $img.Name }}"
- class="img"
- >
- {{ with $p.Title }}{{ . }}{{ else }}{{ $img.Name }}{{ end }}
- </a>
- <span class="badge">image</span>
- {{ $d := $p.Date.Format "2006-01-02" }}{{ if ne $d "0001-01-01" }}<div class="meta">{{ $d }}</div>{{ end }}
- {{ else if $heic }}
- <a
- href="{{ $heic.RelPermalink }}"
- data-name="{{ or $p.Title $heic.Name }}"
- class="heic"
- >
- {{ with $p.Title }}{{ . }}{{ else }}{{ $heic.Name }}{{ end }}
- </a>
- <span class="badge">heic</span>
- {{ $d := $p.Date.Format "2006-01-02" }}{{ if ne $d "0001-01-01" }}<div class="meta">{{ $d }}</div>{{ 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" }}
- <a href="{{ $p.RelPermalink }}">{{ if ne $d "0001-01-01" }}{{ $d }} {{ end }}{{ $p.Title }}</a>
- <span class="badge">note</span>
+ {{ $.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" }}
+ <li data-date="{{ $dateKey }}" data-folder="{{ $folderBase }}">
+ {{ if $vid }}
+ <a href="{{ $vid.RelPermalink }}" data-name="{{ or $p.Title $vid.Name }}" class="vid">
+ {{ with $p.Title }}{{ . }}{{ else }}{{ $vid.Name }}{{ end }}
+ </a>
+ <span class="badge">video</span>
+ {{ $d := $p.Date.Format "2006-01-02" }}{{ if ne $d "0001-01-01" }}<div class="meta">{{ $d }}</div>{{ end }}
+ {{ else if $img }}
+ <a href="{{ $img.RelPermalink }}" data-name="{{ or $p.Title $img.Name }}" class="img">
+ {{ with $p.Title }}{{ . }}{{ else }}{{ $img.Name }}{{ end }}
+ </a>
+ <span class="badge">image</span>
+ {{ $d := $p.Date.Format "2006-01-02" }}{{ if ne $d "0001-01-01" }}<div class="meta">{{ $d }}</div>{{ end }}
+ {{ else if $heic }}
+ <a href="{{ $heic.RelPermalink }}" data-name="{{ or $p.Title $heic.Name }}" class="heic">
+ {{ with $p.Title }}{{ . }}{{ else }}{{ $heic.Name }}{{ end }}
+ </a>
+ <span class="badge">heic</span>
+ {{ $d := $p.Date.Format "2006-01-02" }}{{ if ne $d "0001-01-01" }}<div class="meta">{{ $d }}</div>{{ end }}
+ {{ else }}
+ {{ $d := $p.Date.Format "2006-01-02" }}
+ <a href="{{ $p.RelPermalink }}">{{ if ne $d "0001-01-01" }}{{ $d }} {{ end }}{{ $p.Title }}</a>
+ <span class="badge">note</span>
+ {{ end }}
+ </li>
+ {{ end }}
+ {{ else }}
+ <li class="folder-section">
+ <details>
+ <summary class="folder-header">
+ <span class="folder-name">{{ $m }}/</span>
+ <span class="folder-count">({{ len $pages }} items)</span>
+ </summary>
+ <ul class="folder-content">
+ {{ 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}" }}
+ <li>
+ {{ if $vid }}
+ <a href="{{ $vid.RelPermalink }}" data-name="{{ or $p.Title $vid.Name }}" class="vid">
+ {{ with $p.Title }}{{ . }}{{ else }}{{ $vid.Name }}{{ end }}
+ </a>
+ <span class="badge">video</span>
+ {{ $d := $p.Date.Format "2006-01-02" }}{{ if ne $d "0001-01-01" }}<div class="meta">{{ $d }}</div>{{ end }}
+ {{ else if $img }}
+ <a href="{{ $img.RelPermalink }}" data-name="{{ or $p.Title $img.Name }}" class="img">
+ {{ with $p.Title }}{{ . }}{{ else }}{{ $img.Name }}{{ end }}
+ </a>
+ <span class="badge">image</span>
+ {{ $d := $p.Date.Format "2006-01-02" }}{{ if ne $d "0001-01-01" }}<div class="meta">{{ $d }}</div>{{ end }}
+ {{ else if $heic }}
+ <a href="{{ $heic.RelPermalink }}" data-name="{{ or $p.Title $heic.Name }}" class="heic">
+ {{ with $p.Title }}{{ . }}{{ else }}{{ $heic.Name }}{{ end }}
+ </a>
+ <span class="badge">heic</span>
+ {{ $d := $p.Date.Format "2006-01-02" }}{{ if ne $d "0001-01-01" }}<div class="meta">{{ $d }}</div>{{ end }}
+ {{ else }}
+ {{ $d := $p.Date.Format "2006-01-02" }}
+ <a href="{{ $p.RelPermalink }}">{{ if ne $d "0001-01-01" }}{{ $d }} {{ end }}{{ $p.Title }}</a>
+ <span class="badge">note</span>
+ {{ end }}
+ </li>
+ {{ end }}
+ </ul>
+ </details>
+ </li>
{{ end }}
- </li>
{{ end }}
{{ if and (eq (len $secVids) 0) (eq (len .Pages) 0) }}