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:
22
app/internal/gallery/hero_test.go
Normal file
22
app/internal/gallery/hero_test.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package gallery
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestSelectHero_configured(t *testing.T) {
|
||||
t.Setenv("HERO_IMAGE", "connectionmachine/20220723_231556.jpg")
|
||||
images := []Image{
|
||||
{RelPath: "templeoftechno/IMG_20250817_020719.jpg"},
|
||||
{RelPath: "connectionmachine/20220723_231556.jpg", HeroURL: "/images/hero/connectionmachine/20220723_231556.jpg"},
|
||||
}
|
||||
hero, ok := SelectHero(images)
|
||||
if !ok || hero.RelPath != "connectionmachine/20220723_231556.jpg" {
|
||||
t.Fatalf("got %+v ok=%v", hero, ok)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseDate_20220723(t *testing.T) {
|
||||
tm, year := parseDate("20220723_231556.jpg")
|
||||
if tm.IsZero() || year != 2022 {
|
||||
t.Fatalf("got %v year=%d", tm, year)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user