An experimental IndieWeb site built in Go.
at main 1.9 kB view raw
1// Code generated by templ - DO NOT EDIT. 2 3// templ: version: v0.2.747 4package posts 5 6//lint:file-ignore SA4006 This context is only used if a nested component is present. 7 8import "github.com/a-h/templ" 9import templruntime "github.com/a-h/templ/runtime" 10 11import "github.com/puregarlic/space/models" 12 13func Note(post *models.Post) templ.Component { 14 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { 15 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context 16 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) 17 if !templ_7745c5c3_IsBuffer { 18 defer func() { 19 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) 20 if templ_7745c5c3_Err == nil { 21 templ_7745c5c3_Err = templ_7745c5c3_BufErr 22 } 23 }() 24 } 25 ctx = templ.InitializeContext(ctx) 26 templ_7745c5c3_Var1 := templ.GetChildren(ctx) 27 if templ_7745c5c3_Var1 == nil { 28 templ_7745c5c3_Var1 = templ.NopComponent 29 } 30 ctx = templ.ClearChildren(ctx) 31 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"bg-surface p-4 first:rounded-t last:rounded-b border-2 border-overlay\">") 32 if templ_7745c5c3_Err != nil { 33 return templ_7745c5c3_Err 34 } 35 var templ_7745c5c3_Var2 string 36 templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(GetPostJSONProperty(post, "content")[0]) 37 if templ_7745c5c3_Err != nil { 38 return templ.Error{Err: templ_7745c5c3_Err, FileName: `html/components/posts/note.templ`, Line: 7, Col: 43} 39 } 40 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) 41 if templ_7745c5c3_Err != nil { 42 return templ_7745c5c3_Err 43 } 44 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>") 45 if templ_7745c5c3_Err != nil { 46 return templ_7745c5c3_Err 47 } 48 return templ_7745c5c3_Err 49 }) 50}