Add albums: group photos by free-text tags
An album is a tag. Photos carry lowercase free-text tags in their .toml sidecar (`tags = [...]`), parallel to the existing day grouping — no database, all derived at build time. - albums.go: parseTags (lowercase/trim/dedupe, slug via sanitiseSlug), groupByTag mirroring groupByDay, and rendering for album pages, the index, and the JSON API. Slug collisions between distinct names are suffixed and logged. - Routes: /album/<slug>/ (paginated square grid per tag), /albums/ (index with counts), /tags.json (machine-readable tag list, served statically like feed.xml). - POST /upload gains a `tags` field written into the sidecar; the web upload form gains a tags input. - Tags shown on each photo page linking to their album; an Albums link in the timeline/grid header.
This commit is contained in:
1 parent
f33bdd55b1
commit
a42abfab48
11 files changed
+469
-6
No files matched your search
@@ -58,6 +58,11 @@
|
||||
</div>
|
||||
<p class="dcaption">{{.Photo.Caption}}</p>
|
||||
<p class="ddate">{{.Photo.Date.Format "Jan 02, 2006"}}</p>
|
||||
{{if .Photo.Tags}}
|
||||
<div class="dtags">
|
||||
{{range .Photo.Tags}}<a href="/album/{{.Slug}}/" class="tag">{{.Name}}</a>{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
<p class="dfull"><a href="/{{.Photo.File}}" download>↓ Full size</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user