Add Technical Kiwi website with Go, templ, and HTMX.

Single-page site with gallery by album and event, contact form over SMTP,
Docker dev/prod setup, and on-server image derivatives. Gallery photos stay
local (app/images/ is gitignored).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-25 23:57:59 +12:00
parent c21be097b0
commit 509e7ccb43
33 changed files with 2635 additions and 1 deletions

View File

@@ -0,0 +1,34 @@
package gallery
import (
"os"
"strings"
)
const defaultHeroRel = "connectionmachine/20220723_231556.jpg"
// HeroRelPath returns the configured hero image path relative to images/.
func HeroRelPath() string {
if p := strings.TrimSpace(os.Getenv("HERO_IMAGE")); p != "" {
return filepathToSlash(p)
}
return defaultHeroRel
}
// SelectHero picks the homepage hero from the gallery list.
func SelectHero(images []Image) (Image, bool) {
want := HeroRelPath()
for _, img := range images {
if img.RelPath == want {
return img, true
}
}
if len(images) > 0 {
return images[0], true
}
return Image{}, false
}
func filepathToSlash(p string) string {
return strings.ReplaceAll(p, "\\", "/")
}