Docs
Run
Format
Show HTML
templ
package main import ( "os" ) templ greeting(name string, imgURL string) {
Hello, { name }
Welcome to our site. We're glad to have you here!
} func main() { component := greeting("John", "https://templ.guide/img/logo.svg") component.Render(context.Background(), os.Stdout) }
Output (Source HTML)
Hello, John
Welcome to our site. We're glad to have you here!
Output (Browser)
Hello, John
Welcome to our site. We're glad to have you here!