-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
layout_templ.go
71 lines (66 loc) · 3.03 KB
/
layout_templ.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.543
package views
//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"
import "braces.dev/errtrace"
// Head represents the head section of the layout template.
type Head struct {
Title string // Title represents the title of the page.
Description string // Description represents the description of the page.
}
func Layout(h Head) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype html><html lang=\"en\" class=\"h-full antialiased bg-white\"><head><title>")
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(h.Title)
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ.Error{Err: templ_7745c5c3_Err, FileName: `web/views/layout.templ`, Line: 12, Col: 19})
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</title><meta description=\"")
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(h.Description))
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><script src=\"/static/darkmode.js\"></script><link rel=\"stylesheet\" href=\"/static/app.css\"><link rel=\"stylesheet\" href=\"https://rsms.me/inter/inter.css\"><script src=\"/static/htmx.min.js\"></script></head><body class=\"h-full bg-white dark:bg-gray-900\"><div class=\"min-h-full\">")
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></body></html>")
if templ_7745c5c3_Err != nil {
return errtrace.Wrap(templ_7745c5c3_Err)
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return errtrace.Wrap(templ_7745c5c3_Err)
})
}