diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-09-26 07:33:23 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-09-26 07:33:23 +0900 |
| commit | dab511d87cc83a00cac6be60aada242645d2a5c2 (patch) | |
| tree | b267215ae97a219d08220ffd6b7a68c8168e6f19 | |
| parent | cbae608665261947916dce235fb565ff5aea5598 (diff) | |
modified recordings/_index.md, modified recordings/recordings-plain.html
| -rw-r--r-- | content/recordings/_index.md | 2 | ||||
| -rw-r--r-- | layouts/recordings/recordings-plain.html | 89 |
2 files changed, 90 insertions, 1 deletions
diff --git a/content/recordings/_index.md b/content/recordings/_index.md index a2799bf..8a1887d 100644 --- a/content/recordings/_index.md +++ b/content/recordings/_index.md @@ -6,3 +6,5 @@ type: "recordings" --- 나의 하루하루의 일기들. 매일매일 일기쓰기 도전! + +1207.96.105.2301 diff --git a/layouts/recordings/recordings-plain.html b/layouts/recordings/recordings-plain.html index d06db2c..4c746c4 100644 --- a/layouts/recordings/recordings-plain.html +++ b/layouts/recordings/recordings-plain.html @@ -51,6 +51,45 @@ padding: 2px 6px; margin-left: 6px; } + .folder-section { + margin: 16px 0; + border: 1px solid #ddd; + border-radius: 8px; + background: #f9f9f9; + } + .folder-header { + padding: 8px 12px; + cursor: pointer; + font-weight: 600; + display: flex; + justify-content: space-between; + align-items: center; + } + .folder-header:hover { + background: #f0f0f0; + } + .folder-name { + color: #333; + } + .folder-count { + color: #666; + font-size: 0.9rem; + font-weight: normal; + } + .folder-content { + padding: 0 12px 12px; + margin: 0; + border-top: 1px solid #eee; + background: white; + } + .folder-content li { + margin: 8px 0; + padding: 4px 0; + border-bottom: 1px solid #f0f0f0; + } + .folder-content li:last-child { + border-bottom: none; + } </style> </head> <body> @@ -142,6 +181,52 @@ </li> {{ end }} + <!-- 1-4) 하위 폴더별 트리 구조 --> + {{ $subfolderFiles := .Resources.Match "**/*.{mp4,mov,jpg,jpeg,png,gif,webp,svg,heic,HEIC}" }} + {{ $.Scratch.Set "folderGroups" (dict) }} + {{ range $f := $subfolderFiles }} + {{ $dir := path.Dir $f.RelPermalink }} + {{ if ne $dir "." }} + {{ $folderName := path.Base $dir }} + {{ $currentGroups := $.Scratch.Get "folderGroups" }} + {{ $folderFiles := index $currentGroups $folderName }} + {{ if $folderFiles }} + {{ $.Scratch.Add (printf "folder_%s" $folderName) (slice $f) }} + {{ else }} + {{ $.Scratch.Set (printf "folder_%s" $folderName) (slice $f) }} + {{ $newGroups := merge $currentGroups (dict $folderName true) }} + {{ $.Scratch.Set "folderGroups" $newGroups }} + {{ end }} + {{ end }} + {{ end }} + + {{ $folderGroups := $.Scratch.Get "folderGroups" }} + {{ range $folderName, $exists := $folderGroups }} + {{ $files := $.Scratch.Get (printf "folder_%s" $folderName) }} + <li class="folder-section"> + <details> + <summary class="folder-header"> + <span class="folder-name">{{ $folderName }}/</span> + <span class="folder-count">({{ len $files }} items)</span> + </summary> + <ul class="folder-content"> + {{ range $f := $files }} + {{ $ext := path.Ext $f.Name | lower }} + <li> + <a href="{{ $f.RelPermalink }}" data-name="{{ $f.Name }}" + {{ if in (slice ".mp4" ".mov") $ext }}class="vid"{{ else if in (slice ".jpg" ".jpeg" ".png" ".gif" ".webp" ".svg") $ext }}class="img"{{ else if in (slice ".heic") $ext }}class="heic"{{ end }} + >{{ $f.Name }}</a + > + <span class="badge"> + {{ if in (slice ".mp4" ".mov") $ext }}video{{ else if in (slice ".jpg" ".jpeg" ".png" ".gif" ".webp" ".svg") $ext }}image{{ else if in (slice ".heic") $ext }}heic{{ end }} + </span> + </li> + {{ end }} + </ul> + </details> + </li> + {{ end }} + <!-- 2) 자식 페이지들 (노트/동영상 페이지) --> {{ range $p := .Pages.ByDate.Reverse }} {{ $folder := path.Base (printf "%s" $p.File.Dir) }} @@ -185,7 +270,9 @@ <span class="badge">note</span> {{ end }} </li> - {{ end }} {{ if and (eq (len $secVids) 0) (eq (len .Pages) 0) }} + {{ end }} + + {{ if and (eq (len $secVids) 0) (eq (len .Pages) 0) }} <li>No items yet.</li> {{ end }} </ul> |
