Files
website/Makefile
Jimmy 3f5235daaf 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>
2026-06-04 23:55:43 +12:00

51 lines
1.2 KiB
Makefile

COMPOSE ?= docker compose
# Compose does not support nested ${VAR:-${HOME}/...}; set defaults here (override in .env).
-include .env
export GOMODCACHE ?= $(HOME)/go/pkg/mod
export GOCACHE ?= $(HOME)/.cache/go-build
# One-off commands in the dev image (same caches and ./app mount as `make dev`)
DEV_RUN := $(COMPOSE) run --rm --no-deps -T dev
.PHONY: dev build up down generate tidy logs thumbs sync-media publish convert-videos
.DEFAULT_GOAL := dev
dev:
@test -f .env || cp -n .env.example .env
$(COMPOSE) up --build dev
build:
$(COMPOSE) build website
up:
@test -f .env || cp -n .env.example .env
$(COMPOSE) up --build website
down:
$(COMPOSE) down
generate:
$(DEV_RUN) sh -c "templ generate"
tidy:
$(DEV_RUN) go mod tidy
logs:
$(COMPOSE) logs -f dev
# Pre-build gallery thumbnails and video poster JPEGs (ffmpeg in dev image).
thumbs:
$(DEV_RUN) go run ./cmd/server -thumbs
# Copy photos and convert videos from upload/ into app/images/.
sync-media:
$(DEV_RUN) sh -c 'UPLOAD_DIR=/upload IMAGES_DIR=/app/images ./scripts/sync-media.sh $(ARGS)'
# sync-media then rebuild thumbs/hero derivatives under app/images/.
publish: sync-media thumbs
# Alias for sync-media (videos are converted as part of sync).
convert-videos: sync-media