mirror of
https://github.com/acaloiaro/hugo-htmx-go-template
synced 2026-07-21 18:29:14 +00:00
92 lines
2.1 KiB
Go
92 lines
2.1 KiB
Go
// Code generated by templ@v0.2.304 DO NOT EDIT.
|
|
|
|
package partials
|
|
|
|
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
|
|
|
import "github.com/a-h/templ"
|
|
import "context"
|
|
import "io"
|
|
import "bytes"
|
|
|
|
func HelloWorldGreeting(name string) templ.Component {
|
|
return templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
|
|
templBuffer, templIsBuffer := w.(*bytes.Buffer)
|
|
if !templIsBuffer {
|
|
templBuffer = templ.GetBuffer()
|
|
defer templ.ReleaseBuffer(templBuffer)
|
|
}
|
|
ctx = templ.InitializeContext(ctx)
|
|
var_1 := templ.GetChildren(ctx)
|
|
if var_1 == nil {
|
|
var_1 = templ.NopComponent
|
|
}
|
|
ctx = templ.ClearChildren(ctx)
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<h3>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_2 := `Greeting: Hello, `
|
|
_, err = templBuffer.WriteString(var_2)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// StringExpression
|
|
var var_3 string = name
|
|
_, err = templBuffer.WriteString(templ.EscapeString(var_3))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_4 := `!`
|
|
_, err = templBuffer.WriteString(var_4)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</h3>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if !templIsBuffer {
|
|
_, err = io.Copy(w, templBuffer)
|
|
}
|
|
return err
|
|
})
|
|
}
|
|
|
|
func GoodbyeWorld() templ.Component {
|
|
return templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
|
|
templBuffer, templIsBuffer := w.(*bytes.Buffer)
|
|
if !templIsBuffer {
|
|
templBuffer = templ.GetBuffer()
|
|
defer templ.ReleaseBuffer(templBuffer)
|
|
}
|
|
ctx = templ.InitializeContext(ctx)
|
|
var_5 := templ.GetChildren(ctx)
|
|
if var_5 == nil {
|
|
var_5 = templ.NopComponent
|
|
}
|
|
ctx = templ.ClearChildren(ctx)
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<p>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_6 := `Goodbye, World!`
|
|
_, err = templBuffer.WriteString(var_6)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</p>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if !templIsBuffer {
|
|
_, err = io.Copy(w, templBuffer)
|
|
}
|
|
return err
|
|
})
|
|
}
|