Improve gallery video UX and add upload-to-publish media workflow.
Stage raw files in upload/, publish with make sync-media/publish, and polish the lightbox: autoplay, remembered volume, Escape to close, and image/video icons without poster or caption clutter. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -16,7 +16,7 @@ type Image struct {
|
||||
Collection string // event subfolder label, e.g. Anniversary
|
||||
CollectionKey string // slug for filters
|
||||
Filename string // basename
|
||||
URL string
|
||||
URL string // served file URL (/images/…)
|
||||
ThumbURL string
|
||||
HeroURL string
|
||||
IsVideo bool
|
||||
|
||||
@@ -15,6 +15,9 @@ func isVideo(name string) bool {
|
||||
}
|
||||
|
||||
func isGalleryMedia(name string) bool {
|
||||
if isWebDerivative(name) {
|
||||
return false
|
||||
}
|
||||
return isJPEG(name) || isVideo(name)
|
||||
}
|
||||
|
||||
@@ -34,3 +37,7 @@ func videoPosterRel(rel string) string {
|
||||
}
|
||||
return strings.TrimSuffix(rel, ext) + ".jpg"
|
||||
}
|
||||
|
||||
func isWebDerivative(name string) bool {
|
||||
return strings.HasSuffix(strings.ToLower(name), ".web.mp4")
|
||||
}
|
||||
|
||||
@@ -12,6 +12,15 @@ func TestVideoPosterRel(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsWebDerivative(t *testing.T) {
|
||||
if !isWebDerivative("clip.web.mp4") {
|
||||
t.Fatal("expected web derivative")
|
||||
}
|
||||
if isGalleryMedia("clip.web.mp4") {
|
||||
t.Fatal("web derivative must not be listed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestList_includesVideo(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
album := filepath.Join(dir, "portal")
|
||||
|
||||
Reference in New Issue
Block a user