package main import "fmt" // 1. Shared Base Layout Component templ PageLayout(title string) {
Go server running with Templ templates and Air hot-reloading.
} } // 3. Page 2: About templ AboutPage() { @PageLayout("About") {Single-binary web app using Go's standard library net/http.
} } // Data struct for dynamic rendering type Item struct { Name string Active bool } // 4. Page 3: Dynamic Data (Conditionals + Loops) templ ItemsPage(items []Item) { @PageLayout("Items") {No items in database.
} else {{ fmt.Sprintf("Total items processed: %d", len(items)) }
}