1// Code generated by templ - DO NOT EDIT.
2
3// templ: version: v0.3.1020
4// SPDX-License-Identifier: AGPL-3.0-or-later
5
6package web
7
8//lint:file-ignore SA4006 This context is only used if a nested component is present.
9
10import "github.com/a-h/templ"
11import templruntime "github.com/a-h/templ/runtime"
12
13// Shell is the page: head, the header, the work area (content and rail), the
14// footer, the hint badge, the overlays and the key map. The content is the
15// children.
16func Shell(l Layout, rail templ.Component) templ.Component {
17 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
18 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
19 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
20 return templ_7745c5c3_CtxErr
21 }
22 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
23 if !templ_7745c5c3_IsBuffer {
24 defer func() {
25 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
26 if templ_7745c5c3_Err == nil {
27 templ_7745c5c3_Err = templ_7745c5c3_BufErr
28 }
29 }()
30 }
31 ctx = templ.InitializeContext(ctx)
32 templ_7745c5c3_Var1 := templ.GetChildren(ctx)
33 if templ_7745c5c3_Var1 == nil {
34 templ_7745c5c3_Var1 = templ.NopComponent
35 }
36 ctx = templ.ClearChildren(ctx)
37 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><meta name=\"color-scheme\" content=\"light dark\"><title>")
38 if templ_7745c5c3_Err != nil {
39 return templ_7745c5c3_Err
40 }
41 var templ_7745c5c3_Var2 string
42 templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(l.Title)
43 if templ_7745c5c3_Err != nil {
44 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 15, Col: 19}
45 }
46 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
47 if templ_7745c5c3_Err != nil {
48 return templ_7745c5c3_Err
49 }
50 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</title><meta name=\"theme-color\" data-scheme=\"light\" media=\"(prefers-color-scheme: light)\" content=\"#ffffff\"><meta name=\"theme-color\" data-scheme=\"dark\" media=\"(prefers-color-scheme: dark)\" content=\"#0c0c0c\"><meta name=\"apple-mobile-web-app-title\" content=\"ermite\"><link rel=\"icon\" type=\"image/svg+xml\" href=\"")
51 if templ_7745c5c3_Err != nil {
52 return templ_7745c5c3_Err
53 }
54 var templ_7745c5c3_Var3 templ.SafeURL
55 templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(l.Assets.Icon))
56 if templ_7745c5c3_Err != nil {
57 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 19, Col: 76}
58 }
59 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
60 if templ_7745c5c3_Err != nil {
61 return templ_7745c5c3_Err
62 }
63 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\"><link rel=\"apple-touch-icon\" href=\"")
64 if templ_7745c5c3_Err != nil {
65 return templ_7745c5c3_Err
66 }
67 var templ_7745c5c3_Var4 templ.SafeURL
68 templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(l.Assets.AppleIcon))
69 if templ_7745c5c3_Err != nil {
70 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 20, Col: 72}
71 }
72 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
73 if templ_7745c5c3_Err != nil {
74 return templ_7745c5c3_Err
75 }
76 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\"><link rel=\"manifest\" href=\"")
77 if templ_7745c5c3_Err != nil {
78 return templ_7745c5c3_Err
79 }
80 var templ_7745c5c3_Var5 templ.SafeURL
81 templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(l.Assets.Manifest))
82 if templ_7745c5c3_Err != nil {
83 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 21, Col: 63}
84 }
85 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
86 if templ_7745c5c3_Err != nil {
87 return templ_7745c5c3_Err
88 }
89 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "\"><link rel=\"preload\" href=\"")
90 if templ_7745c5c3_Err != nil {
91 return templ_7745c5c3_Err
92 }
93 var templ_7745c5c3_Var6 templ.SafeURL
94 templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(l.Assets.Font))
95 if templ_7745c5c3_Err != nil {
96 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 22, Col: 58}
97 }
98 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
99 if templ_7745c5c3_Err != nil {
100 return templ_7745c5c3_Err
101 }
102 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "\" as=\"font\" type=\"font/woff2\" crossorigin><link rel=\"stylesheet\" href=\"")
103 if templ_7745c5c3_Err != nil {
104 return templ_7745c5c3_Err
105 }
106 var templ_7745c5c3_Var7 templ.SafeURL
107 templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(l.Assets.CSS))
108 if templ_7745c5c3_Err != nil {
109 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 23, Col: 60}
110 }
111 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
112 if templ_7745c5c3_Err != nil {
113 return templ_7745c5c3_Err
114 }
115 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "\"><meta name=\"htmx-config\" content='{\"history\":false,\"includeIndicatorCSS\":false,\"extensions\":\"sse, hx-live\"}'><script src=\"")
116 if templ_7745c5c3_Err != nil {
117 return templ_7745c5c3_Err
118 }
119 var templ_7745c5c3_Var8 string
120 templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.HTMX)
121 if templ_7745c5c3_Err != nil {
122 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 25, Col: 30}
123 }
124 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8)
125 if templ_7745c5c3_Err != nil {
126 return templ_7745c5c3_Err
127 }
128 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "\" defer></script><script src=\"")
129 if templ_7745c5c3_Err != nil {
130 return templ_7745c5c3_Err
131 }
132 var templ_7745c5c3_Var9 string
133 templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.Live)
134 if templ_7745c5c3_Err != nil {
135 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 26, Col: 30}
136 }
137 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
138 if templ_7745c5c3_Err != nil {
139 return templ_7745c5c3_Err
140 }
141 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "\" defer></script><script src=\"")
142 if templ_7745c5c3_Err != nil {
143 return templ_7745c5c3_Err
144 }
145 var templ_7745c5c3_Var10 string
146 templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.SSE)
147 if templ_7745c5c3_Err != nil {
148 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 27, Col: 29}
149 }
150 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10)
151 if templ_7745c5c3_Err != nil {
152 return templ_7745c5c3_Err
153 }
154 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "\" defer></script><script src=\"")
155 if templ_7745c5c3_Err != nil {
156 return templ_7745c5c3_Err
157 }
158 var templ_7745c5c3_Var11 string
159 templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.Store)
160 if templ_7745c5c3_Err != nil {
161 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 28, Col: 31}
162 }
163 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11)
164 if templ_7745c5c3_Err != nil {
165 return templ_7745c5c3_Err
166 }
167 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "\"></script><script src=\"")
168 if templ_7745c5c3_Err != nil {
169 return templ_7745c5c3_Err
170 }
171 var templ_7745c5c3_Var12 string
172 templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.App)
173 if templ_7745c5c3_Err != nil {
174 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 29, Col: 29}
175 }
176 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12)
177 if templ_7745c5c3_Err != nil {
178 return templ_7745c5c3_Err
179 }
180 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "\" defer></script><script src=\"")
181 if templ_7745c5c3_Err != nil {
182 return templ_7745c5c3_Err
183 }
184 var templ_7745c5c3_Var13 string
185 templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.Files)
186 if templ_7745c5c3_Err != nil {
187 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 30, Col: 31}
188 }
189 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13)
190 if templ_7745c5c3_Err != nil {
191 return templ_7745c5c3_Err
192 }
193 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "\" defer></script><script src=\"")
194 if templ_7745c5c3_Err != nil {
195 return templ_7745c5c3_Err
196 }
197 var templ_7745c5c3_Var14 string
198 templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.Passkey)
199 if templ_7745c5c3_Err != nil {
200 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 31, Col: 33}
201 }
202 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14)
203 if templ_7745c5c3_Err != nil {
204 return templ_7745c5c3_Err
205 }
206 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "\" defer></script><script src=\"")
207 if templ_7745c5c3_Err != nil {
208 return templ_7745c5c3_Err
209 }
210 var templ_7745c5c3_Var15 string
211 templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.Log)
212 if templ_7745c5c3_Err != nil {
213 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 32, Col: 29}
214 }
215 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var15)
216 if templ_7745c5c3_Err != nil {
217 return templ_7745c5c3_Err
218 }
219 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "\" defer></script>")
220 if templ_7745c5c3_Err != nil {
221 return templ_7745c5c3_Err
222 }
223 if l.Lazy {
224 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<script src=\"")
225 if templ_7745c5c3_Err != nil {
226 return templ_7745c5c3_Err
227 }
228 var templ_7745c5c3_Var16 string
229 templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.Lazy)
230 if templ_7745c5c3_Err != nil {
231 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 34, Col: 31}
232 }
233 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var16)
234 if templ_7745c5c3_Err != nil {
235 return templ_7745c5c3_Err
236 }
237 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "\" defer></script>")
238 if templ_7745c5c3_Err != nil {
239 return templ_7745c5c3_Err
240 }
241 }
242 if l.MR {
243 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<script src=\"")
244 if templ_7745c5c3_Err != nil {
245 return templ_7745c5c3_Err
246 }
247 var templ_7745c5c3_Var17 string
248 templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.MR)
249 if templ_7745c5c3_Err != nil {
250 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 37, Col: 29}
251 }
252 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var17)
253 if templ_7745c5c3_Err != nil {
254 return templ_7745c5c3_Err
255 }
256 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "\" defer></script>")
257 if templ_7745c5c3_Err != nil {
258 return templ_7745c5c3_Err
259 }
260 }
261 if l.IssueForm {
262 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<script src=\"")
263 if templ_7745c5c3_Err != nil {
264 return templ_7745c5c3_Err
265 }
266 var templ_7745c5c3_Var18 string
267 templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.IssueForm)
268 if templ_7745c5c3_Err != nil {
269 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 40, Col: 36}
270 }
271 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var18)
272 if templ_7745c5c3_Err != nil {
273 return templ_7745c5c3_Err
274 }
275 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "\" defer></script>")
276 if templ_7745c5c3_Err != nil {
277 return templ_7745c5c3_Err
278 }
279 }
280 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</head><body data-ref=\"")
281 if templ_7745c5c3_Err != nil {
282 return templ_7745c5c3_Err
283 }
284 var templ_7745c5c3_Var19 string
285 templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.RefPath)
286 if templ_7745c5c3_Err != nil {
287 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 44, Col: 23}
288 }
289 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var19)
290 if templ_7745c5c3_Err != nil {
291 return templ_7745c5c3_Err
292 }
293 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "\" data-sha=\"")
294 if templ_7745c5c3_Err != nil {
295 return templ_7745c5c3_Err
296 }
297 var templ_7745c5c3_Var20 string
298 templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.SHA)
299 if templ_7745c5c3_Err != nil {
300 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 45, Col: 19}
301 }
302 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var20)
303 if templ_7745c5c3_Err != nil {
304 return templ_7745c5c3_Err
305 }
306 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "\" data-sel=\"\" data-nav=\"\"")
307 if templ_7745c5c3_Err != nil {
308 return templ_7745c5c3_Err
309 }
310 if l.PathsURL != "" {
311 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, " data-paths=\"")
312 if templ_7745c5c3_Err != nil {
313 return templ_7745c5c3_Err
314 }
315 var templ_7745c5c3_Var21 string
316 templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.PathsURL)
317 if templ_7745c5c3_Err != nil {
318 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 49, Col: 27}
319 }
320 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var21)
321 if templ_7745c5c3_Err != nil {
322 return templ_7745c5c3_Err
323 }
324 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "\" data-blob=\"")
325 if templ_7745c5c3_Err != nil {
326 return templ_7745c5c3_Err
327 }
328 var templ_7745c5c3_Var22 string
329 templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.BlobBase)
330 if templ_7745c5c3_Err != nil {
331 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 50, Col: 26}
332 }
333 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var22)
334 if templ_7745c5c3_Err != nil {
335 return templ_7745c5c3_Err
336 }
337 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "\"")
338 if templ_7745c5c3_Err != nil {
339 return templ_7745c5c3_Err
340 }
341 }
342 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "><a class=\"skip\" href=\"#main\">skip to content</a>")
343 if templ_7745c5c3_Err != nil {
344 return templ_7745c5c3_Err
345 }
346 templ_7745c5c3_Err = Header(l).Render(ctx, templ_7745c5c3_Buffer)
347 if templ_7745c5c3_Err != nil {
348 return templ_7745c5c3_Err
349 }
350 var templ_7745c5c3_Var23 = []any{"work", templ.KV("has-rail", l.HasRail && rail != nil)}
351 templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var23...)
352 if templ_7745c5c3_Err != nil {
353 return templ_7745c5c3_Err
354 }
355 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "<div class=\"")
356 if templ_7745c5c3_Err != nil {
357 return templ_7745c5c3_Err
358 }
359 var templ_7745c5c3_Var24 string
360 templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.ResolveAttributeValue(templ.CSSClasses(templ_7745c5c3_Var23).String())
361 if templ_7745c5c3_Err != nil {
362 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 1, Col: 0}
363 }
364 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24)
365 if templ_7745c5c3_Err != nil {
366 return templ_7745c5c3_Err
367 }
368 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "\">")
369 if templ_7745c5c3_Err != nil {
370 return templ_7745c5c3_Err
371 }
372 if l.Lede != "" {
373 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "<section class=\"work-lede\" aria-label=\"Description\"><p class=\"lede\">")
374 if templ_7745c5c3_Err != nil {
375 return templ_7745c5c3_Err
376 }
377 var templ_7745c5c3_Var25 string
378 templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(l.Lede)
379 if templ_7745c5c3_Err != nil {
380 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 57, Col: 81}
381 }
382 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
383 if templ_7745c5c3_Err != nil {
384 return templ_7745c5c3_Err
385 }
386 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "</p></section>")
387 if templ_7745c5c3_Err != nil {
388 return templ_7745c5c3_Err
389 }
390 }
391 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "<main id=\"main\" tabindex=\"-1\">")
392 if templ_7745c5c3_Err != nil {
393 return templ_7745c5c3_Err
394 }
395 templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer)
396 if templ_7745c5c3_Err != nil {
397 return templ_7745c5c3_Err
398 }
399 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "</main>")
400 if templ_7745c5c3_Err != nil {
401 return templ_7745c5c3_Err
402 }
403 if l.HasRail && rail != nil {
404 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "<aside class=\"rail\" aria-label=\"Context\">")
405 if templ_7745c5c3_Err != nil {
406 return templ_7745c5c3_Err
407 }
408 templ_7745c5c3_Err = rail.Render(ctx, templ_7745c5c3_Buffer)
409 if templ_7745c5c3_Err != nil {
410 return templ_7745c5c3_Err
411 }
412 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "</aside>")
413 if templ_7745c5c3_Err != nil {
414 return templ_7745c5c3_Err
415 }
416 }
417 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "</div>")
418 if templ_7745c5c3_Err != nil {
419 return templ_7745c5c3_Err
420 }
421 templ_7745c5c3_Err = Footer(l).Render(ctx, templ_7745c5c3_Buffer)
422 if templ_7745c5c3_Err != nil {
423 return templ_7745c5c3_Err
424 }
425 templ_7745c5c3_Err = Hint(l).Render(ctx, templ_7745c5c3_Buffer)
426 if templ_7745c5c3_Err != nil {
427 return templ_7745c5c3_Err
428 }
429 if SignedIn(ctx) {
430 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "<a hidden data-inbox href=\"")
431 if templ_7745c5c3_Err != nil {
432 return templ_7745c5c3_Err
433 }
434 var templ_7745c5c3_Var26 templ.SafeURL
435 templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinURLErrs(inboxPath)
436 if templ_7745c5c3_Err != nil {
437 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 71, Col: 41}
438 }
439 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
440 if templ_7745c5c3_Err != nil {
441 return templ_7745c5c3_Err
442 }
443 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "\">Inbox</a>")
444 if templ_7745c5c3_Err != nil {
445 return templ_7745c5c3_Err
446 }
447 }
448 templ_7745c5c3_Err = OverlayHelp(l.MR).Render(ctx, templ_7745c5c3_Buffer)
449 if templ_7745c5c3_Err != nil {
450 return templ_7745c5c3_Err
451 }
452 templ_7745c5c3_Err = OverlayRefs(l).Render(ctx, templ_7745c5c3_Buffer)
453 if templ_7745c5c3_Err != nil {
454 return templ_7745c5c3_Err
455 }
456 templ_7745c5c3_Err = OverlayCmd(l.Cmd).Render(ctx, templ_7745c5c3_Buffer)
457 if templ_7745c5c3_Err != nil {
458 return templ_7745c5c3_Err
459 }
460 templ_7745c5c3_Err = Keys().Render(ctx, templ_7745c5c3_Buffer)
461 if templ_7745c5c3_Err != nil {
462 return templ_7745c5c3_Err
463 }
464 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "</body></html>")
465 if templ_7745c5c3_Err != nil {
466 return templ_7745c5c3_Err
467 }
468 return nil
469 })
470}
471
472// Header is the page header: the logo (home), the path, the ref switcher,
473// the "go to" palette and the owner; inside a repository, the tabs below.
474func Header(l Layout) templ.Component {
475 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
476 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
477 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
478 return templ_7745c5c3_CtxErr
479 }
480 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
481 if !templ_7745c5c3_IsBuffer {
482 defer func() {
483 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
484 if templ_7745c5c3_Err == nil {
485 templ_7745c5c3_Err = templ_7745c5c3_BufErr
486 }
487 }()
488 }
489 ctx = templ.InitializeContext(ctx)
490 templ_7745c5c3_Var27 := templ.GetChildren(ctx)
491 if templ_7745c5c3_Var27 == nil {
492 templ_7745c5c3_Var27 = templ.NopComponent
493 }
494 ctx = templ.ClearChildren(ctx)
495 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "<header class=\"hdr\"><div class=\"hdr-top\"><a class=\"brand\" href=\"/\" data-g=\"h\" aria-label=\"home\" title=\"home (g h)\"><span class=\"brand-mark\" aria-hidden=\"true\"></span></a> ")
496 if templ_7745c5c3_Err != nil {
497 return templ_7745c5c3_Err
498 }
499 if l.Inbox != nil {
500 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "<a class=\"btn inbox-btn\" href=\"")
501 if templ_7745c5c3_Err != nil {
502 return templ_7745c5c3_Err
503 }
504 var templ_7745c5c3_Var28 templ.SafeURL
505 templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(l.Inbox.Href))
506 if templ_7745c5c3_Err != nil {
507 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 92, Col: 39}
508 }
509 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
510 if templ_7745c5c3_Err != nil {
511 return templ_7745c5c3_Err
512 }
513 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "\" title=\"inbox (I)\" aria-keyshortcuts=\"Shift+I\"><span class=\"ico i-mailbox\" aria-hidden=\"true\"></span> Inbox ")
514 if templ_7745c5c3_Err != nil {
515 return templ_7745c5c3_Err
516 }
517 if l.Inbox.Count >= 0 {
518 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "<span class=\"count\">")
519 if templ_7745c5c3_Err != nil {
520 return templ_7745c5c3_Err
521 }
522 var templ_7745c5c3_Var29 string
523 templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(l.Inbox.Count))
524 if templ_7745c5c3_Err != nil {
525 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 99, Col: 47}
526 }
527 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
528 if templ_7745c5c3_Err != nil {
529 return templ_7745c5c3_Err
530 }
531 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "</span>")
532 if templ_7745c5c3_Err != nil {
533 return templ_7745c5c3_Err
534 }
535 }
536 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "</a> ")
537 if templ_7745c5c3_Err != nil {
538 return templ_7745c5c3_Err
539 }
540 }
541 if len(l.Crumbs) > 0 {
542 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "<nav class=\"crumbs\" aria-label=\"Path\"><ol>")
543 if templ_7745c5c3_Err != nil {
544 return templ_7745c5c3_Err
545 }
546 for _, c := range l.Crumbs {
547 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "<li>")
548 if templ_7745c5c3_Err != nil {
549 return templ_7745c5c3_Err
550 }
551 if c.Href != "" {
552 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "<a href=\"")
553 if templ_7745c5c3_Err != nil {
554 return templ_7745c5c3_Err
555 }
556 var templ_7745c5c3_Var30 templ.SafeURL
557 templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Href))
558 if templ_7745c5c3_Err != nil {
559 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 110, Col: 38}
560 }
561 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
562 if templ_7745c5c3_Err != nil {
563 return templ_7745c5c3_Err
564 }
565 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "\"")
566 if templ_7745c5c3_Err != nil {
567 return templ_7745c5c3_Err
568 }
569 if c.Current {
570 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, " aria-current=\"page\"")
571 if templ_7745c5c3_Err != nil {
572 return templ_7745c5c3_Err
573 }
574 }
575 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, ">")
576 if templ_7745c5c3_Err != nil {
577 return templ_7745c5c3_Err
578 }
579 var templ_7745c5c3_Var31 string
580 templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(c.Label)
581 if templ_7745c5c3_Err != nil {
582 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 114, Col: 19}
583 }
584 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
585 if templ_7745c5c3_Err != nil {
586 return templ_7745c5c3_Err
587 }
588 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "</a>")
589 if templ_7745c5c3_Err != nil {
590 return templ_7745c5c3_Err
591 }
592 } else {
593 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "<span")
594 if templ_7745c5c3_Err != nil {
595 return templ_7745c5c3_Err
596 }
597 if c.Current {
598 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, " aria-current=\"page\"")
599 if templ_7745c5c3_Err != nil {
600 return templ_7745c5c3_Err
601 }
602 }
603 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, ">")
604 if templ_7745c5c3_Err != nil {
605 return templ_7745c5c3_Err
606 }
607 var templ_7745c5c3_Var32 string
608 templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(c.Label)
609 if templ_7745c5c3_Err != nil {
610 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 120, Col: 19}
611 }
612 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
613 if templ_7745c5c3_Err != nil {
614 return templ_7745c5c3_Err
615 }
616 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "</span>")
617 if templ_7745c5c3_Err != nil {
618 return templ_7745c5c3_Err
619 }
620 }
621 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "</li>")
622 if templ_7745c5c3_Err != nil {
623 return templ_7745c5c3_Err
624 }
625 }
626 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "</ol></nav>")
627 if templ_7745c5c3_Err != nil {
628 return templ_7745c5c3_Err
629 }
630 }
631 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "<div class=\"hdr-acts\">")
632 if templ_7745c5c3_Err != nil {
633 return templ_7745c5c3_Err
634 }
635 if l.Ref != "" {
636 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "<a class=\"btn ref\" href=\"")
637 if templ_7745c5c3_Err != nil {
638 return templ_7745c5c3_Err
639 }
640 var templ_7745c5c3_Var33 templ.SafeURL
641 templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(repoHref(l.Repo, "refs")))
642 if templ_7745c5c3_Err != nil {
643 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 131, Col: 52}
644 }
645 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33))
646 if templ_7745c5c3_Err != nil {
647 return templ_7745c5c3_Err
648 }
649 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "\" data-fire=\"refs\" aria-keyshortcuts=\"b\" title=\"switch branch or tag (b)\"><span class=\"ico i-branch\" aria-hidden=\"true\"></span> <span class=\"ref-name\">")
650 if templ_7745c5c3_Err != nil {
651 return templ_7745c5c3_Err
652 }
653 var templ_7745c5c3_Var34 string
654 templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(l.Ref)
655 if templ_7745c5c3_Err != nil {
656 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 137, Col: 36}
657 }
658 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34))
659 if templ_7745c5c3_Err != nil {
660 return templ_7745c5c3_Err
661 }
662 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "</span> <span class=\"sha\">")
663 if templ_7745c5c3_Err != nil {
664 return templ_7745c5c3_Err
665 }
666 var templ_7745c5c3_Var35 string
667 templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(l.Short)
668 if templ_7745c5c3_Err != nil {
669 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 138, Col: 33}
670 }
671 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
672 if templ_7745c5c3_Err != nil {
673 return templ_7745c5c3_Err
674 }
675 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "</span></a> ")
676 if templ_7745c5c3_Err != nil {
677 return templ_7745c5c3_Err
678 }
679 }
680 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "<button type=\"button\" class=\"btn search\" data-js aria-haspopup=\"dialog\" aria-controls=\"panel-cmd\" aria-keyshortcuts=\"Control+K :\" title=\"go to a section, ref, file or repo (ctrl k or :)\" data-fire=\"cmd\"><span class=\"ico i-search\" aria-hidden=\"true\"></span> <span class=\"search-label\">Go to…</span> <kbd aria-hidden=\"true\">ctrl k</kbd></button> ")
681 if templ_7745c5c3_Err != nil {
682 return templ_7745c5c3_Err
683 }
684 if SignedIn(ctx) {
685 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "<form class=\"owner\" method=\"post\" action=\"/-/logout\"><span class=\"owner-badge\" title=\"signed in as the owner\"><span class=\"ico i-user\" aria-hidden=\"true\"></span>")
686 if templ_7745c5c3_Err != nil {
687 return templ_7745c5c3_Err
688 }
689 var templ_7745c5c3_Var36 string
690 templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(l.Owner)
691 if templ_7745c5c3_Err != nil {
692 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 157, Col: 123}
693 }
694 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36))
695 if templ_7745c5c3_Err != nil {
696 return templ_7745c5c3_Err
697 }
698 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "</span> ")
699 if templ_7745c5c3_Err != nil {
700 return templ_7745c5c3_Err
701 }
702 if l.Passkeys {
703 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "<a class=\"btn icon\" href=\"/-/passkeys\" aria-label=\"Passkeys\" title=\"passkeys: add or remove the passkeys that sign you in\"><span class=\"ico i-key\" aria-hidden=\"true\"></span></a> ")
704 if templ_7745c5c3_Err != nil {
705 return templ_7745c5c3_Err
706 }
707 }
708 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "<button type=\"submit\" class=\"btn icon\" aria-label=\"Sign out\" title=\"sign out of this browser\"><span class=\"ico i-log-out\" aria-hidden=\"true\"></span></button></form>")
709 if templ_7745c5c3_Err != nil {
710 return templ_7745c5c3_Err
711 }
712 } else if l.Passkeys {
713 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, "<a class=\"btn icon\" href=\"/-/login\" aria-label=\"Sign in\" title=\"sign in with a passkey\"><span class=\"ico i-log-in\" aria-hidden=\"true\"></span></a>")
714 if templ_7745c5c3_Err != nil {
715 return templ_7745c5c3_Err
716 }
717 }
718 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "</div></div>")
719 if templ_7745c5c3_Err != nil {
720 return templ_7745c5c3_Err
721 }
722 if len(l.Sections) > 0 {
723 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "<nav class=\"tabs\" aria-label=\"Sections\"><ul>")
724 if templ_7745c5c3_Err != nil {
725 return templ_7745c5c3_Err
726 }
727 for _, s := range l.Sections {
728 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, "<li><a href=\"")
729 if templ_7745c5c3_Err != nil {
730 return templ_7745c5c3_Err
731 }
732 var templ_7745c5c3_Var37 templ.SafeURL
733 templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(s.Href))
734 if templ_7745c5c3_Err != nil {
735 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 174, Col: 36}
736 }
737 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
738 if templ_7745c5c3_Err != nil {
739 return templ_7745c5c3_Err
740 }
741 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 74, "\" data-key=\"")
742 if templ_7745c5c3_Err != nil {
743 return templ_7745c5c3_Err
744 }
745 var templ_7745c5c3_Var38 string
746 templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.ResolveAttributeValue("g " + s.Key)
747 if templ_7745c5c3_Err != nil {
748 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 175, Col: 31}
749 }
750 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var38)
751 if templ_7745c5c3_Err != nil {
752 return templ_7745c5c3_Err
753 }
754 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 75, "\"")
755 if templ_7745c5c3_Err != nil {
756 return templ_7745c5c3_Err
757 }
758 if s.Current {
759 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 76, " aria-current=\"page\"")
760 if templ_7745c5c3_Err != nil {
761 return templ_7745c5c3_Err
762 }
763 }
764 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 77, ">")
765 if templ_7745c5c3_Err != nil {
766 return templ_7745c5c3_Err
767 }
768 var templ_7745c5c3_Var39 string
769 templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(s.Label)
770 if templ_7745c5c3_Err != nil {
771 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 180, Col: 17}
772 }
773 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39))
774 if templ_7745c5c3_Err != nil {
775 return templ_7745c5c3_Err
776 }
777 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 78, " ")
778 if templ_7745c5c3_Err != nil {
779 return templ_7745c5c3_Err
780 }
781 if s.Count != "" {
782 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 79, "<span class=\"count\">")
783 if templ_7745c5c3_Err != nil {
784 return templ_7745c5c3_Err
785 }
786 var templ_7745c5c3_Var40 string
787 templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.JoinStringErrs(s.Count)
788 if templ_7745c5c3_Err != nil {
789 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 182, Col: 38}
790 }
791 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var40))
792 if templ_7745c5c3_Err != nil {
793 return templ_7745c5c3_Err
794 }
795 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 80, "<span class=\"sr\">")
796 if templ_7745c5c3_Err != nil {
797 return templ_7745c5c3_Err
798 }
799 var templ_7745c5c3_Var41 string
800 templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(" open")
801 if templ_7745c5c3_Err != nil {
802 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 182, Col: 66}
803 }
804 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41))
805 if templ_7745c5c3_Err != nil {
806 return templ_7745c5c3_Err
807 }
808 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 81, "</span></span> ")
809 if templ_7745c5c3_Err != nil {
810 return templ_7745c5c3_Err
811 }
812 }
813 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 82, "<kbd aria-hidden=\"true\">")
814 if templ_7745c5c3_Err != nil {
815 return templ_7745c5c3_Err
816 }
817 var templ_7745c5c3_Var42 string
818 templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinStringErrs("g " + s.Key)
819 if templ_7745c5c3_Err != nil {
820 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 184, Col: 46}
821 }
822 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42))
823 if templ_7745c5c3_Err != nil {
824 return templ_7745c5c3_Err
825 }
826 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 83, "</kbd></a></li>")
827 if templ_7745c5c3_Err != nil {
828 return templ_7745c5c3_Err
829 }
830 }
831 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 84, "</ul></nav>")
832 if templ_7745c5c3_Err != nil {
833 return templ_7745c5c3_Err
834 }
835 }
836 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 85, "</header>")
837 if templ_7745c5c3_Err != nil {
838 return templ_7745c5c3_Err
839 }
840 return nil
841 })
842}
843
844// Footer is the version and the link to the source of the running version,
845// which the AGPL §13 asks every user of the service to be offered, then the
846// keyboard shortcuts and the theme switch (auto, light, dark; ermite.js shows
847// the stored mode).
848func Footer(l Layout) templ.Component {
849 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
850 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
851 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
852 return templ_7745c5c3_CtxErr
853 }
854 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
855 if !templ_7745c5c3_IsBuffer {
856 defer func() {
857 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
858 if templ_7745c5c3_Err == nil {
859 templ_7745c5c3_Err = templ_7745c5c3_BufErr
860 }
861 }()
862 }
863 ctx = templ.InitializeContext(ctx)
864 templ_7745c5c3_Var43 := templ.GetChildren(ctx)
865 if templ_7745c5c3_Var43 == nil {
866 templ_7745c5c3_Var43 = templ.NopComponent
867 }
868 ctx = templ.ClearChildren(ctx)
869 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 86, "<footer class=\"foot\"><span>ermite ")
870 if templ_7745c5c3_Err != nil {
871 return templ_7745c5c3_Err
872 }
873 var templ_7745c5c3_Var44 string
874 templ_7745c5c3_Var44, templ_7745c5c3_Err = templ.JoinStringErrs(l.Version)
875 if templ_7745c5c3_Err != nil {
876 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 200, Col: 26}
877 }
878 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var44))
879 if templ_7745c5c3_Err != nil {
880 return templ_7745c5c3_Err
881 }
882 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 87, "</span> <a href=\"")
883 if templ_7745c5c3_Err != nil {
884 return templ_7745c5c3_Err
885 }
886 var templ_7745c5c3_Var45 templ.SafeURL
887 templ_7745c5c3_Var45, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(l.SourceURL))
888 if templ_7745c5c3_Err != nil {
889 return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 201, Col: 38}
890 }
891 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var45))
892 if templ_7745c5c3_Err != nil {
893 return templ_7745c5c3_Err
894 }
895 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 88, "\" rel=\"noopener\" title=\"source of this version (AGPL-3.0-or-later)\">source</a> <button type=\"button\" class=\"foot-keys\" data-js data-fire=\"help\" aria-haspopup=\"dialog\" aria-controls=\"panel-help\" aria-keyshortcuts=\"?\"><kbd aria-hidden=\"true\">?</kbd> keyboard shortcuts</button> <button type=\"button\" class=\"foot-theme\" data-js data-theme-switch aria-label=\"theme: auto (switch to light)\" title=\"theme: auto (switch to light)\"><span class=\"ico i-sun-moon\" aria-hidden=\"true\"></span></button></footer>")
896 if templ_7745c5c3_Err != nil {
897 return templ_7745c5c3_Err
898 }
899 return nil
900 })
901}
902
903// Hint is the floating badge at the bottom right. It shows only what the
904// keyboard just did or what needs attention: the row position while j/k
905// move, the selected lines of a file, a flash message (permalink copied) and
906// a lost event stream. Empty, it takes no room.
907func Hint(l Layout) templ.Component {
908 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
909 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
910 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
911 return templ_7745c5c3_CtxErr
912 }
913 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
914 if !templ_7745c5c3_IsBuffer {
915 defer func() {
916 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
917 if templ_7745c5c3_Err == nil {
918 templ_7745c5c3_Err = templ_7745c5c3_BufErr
919 }
920 }()
921 }
922 ctx = templ.InitializeContext(ctx)
923 templ_7745c5c3_Var46 := templ.GetChildren(ctx)
924 if templ_7745c5c3_Var46 == nil {
925 templ_7745c5c3_Var46 = templ.NopComponent
926 }
927 ctx = templ.ClearChildren(ctx)
928 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 89, "<div class=\"hint\"><span aria-hidden=\"true\" class=\"hint-nav\" :text=\"document.body.dataset.nav || ''\"></span> <span role=\"status\" aria-live=\"polite\"><span class=\"hint-sel\" :text=\"document.body.dataset.sel ? document.body.dataset.sel + ' · y permalink' : ''\"></span> <span class=\"hint-flash\" :text=\"document.body.dataset.flash || ''\"></span></span>")
929 if templ_7745c5c3_Err != nil {
930 return templ_7745c5c3_Err
931 }
932 templ_7745c5c3_Err = Live(l).Render(ctx, templ_7745c5c3_Buffer)
933 if templ_7745c5c3_Err != nil {
934 return templ_7745c5c3_Err
935 }
936 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 90, "</div>")
937 if templ_7745c5c3_Err != nil {
938 return templ_7745c5c3_Err
939 }
940 return nil
941 })
942}
943
944var _ = templruntime.GeneratedTemplate