An experimental IndieWeb site built in Go.
1// Code generated by templ - DO NOT EDIT.
2
3// templ: version: v0.2.747
4package layouts
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 (
12 "github.com/puregarlic/space/html/components"
13 "net/http"
14)
15
16func RenderDefault(title string, page templ.Component) http.Handler {
17 document := Default(title, page)
18
19 return templ.Handler(document)
20}
21
22func Default(title string, body templ.Component) templ.Component {
23 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
24 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
25 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
26 if !templ_7745c5c3_IsBuffer {
27 defer func() {
28 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
29 if templ_7745c5c3_Err == nil {
30 templ_7745c5c3_Err = templ_7745c5c3_BufErr
31 }
32 }()
33 }
34 ctx = templ.InitializeContext(ctx)
35 templ_7745c5c3_Var1 := templ.GetChildren(ctx)
36 if templ_7745c5c3_Var1 == nil {
37 templ_7745c5c3_Var1 = templ.NopComponent
38 }
39 ctx = templ.ClearChildren(ctx)
40 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype html><html>")
41 if templ_7745c5c3_Err != nil {
42 return templ_7745c5c3_Err
43 }
44 templ_7745c5c3_Err = components.Head(title).Render(ctx, templ_7745c5c3_Buffer)
45 if templ_7745c5c3_Err != nil {
46 return templ_7745c5c3_Err
47 }
48 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<body class=\"px-4 py-12 md:py-20 text-text bg-base\">")
49 if templ_7745c5c3_Err != nil {
50 return templ_7745c5c3_Err
51 }
52 templ_7745c5c3_Err = body.Render(ctx, templ_7745c5c3_Buffer)
53 if templ_7745c5c3_Err != nil {
54 return templ_7745c5c3_Err
55 }
56 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</body></html>")
57 if templ_7745c5c3_Err != nil {
58 return templ_7745c5c3_Err
59 }
60 return templ_7745c5c3_Err
61 })
62}