v0.5.0 bfab294

shell_templ.go RawHistoryFolder

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><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: 16, 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=\"preload\" 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.Font))
69		if templ_7745c5c3_Err != nil {
70			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 17, Col: 58}
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, "\" as=\"font\" type=\"font/woff2\" crossorigin><link rel=\"stylesheet\" 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.CSS))
82		if templ_7745c5c3_Err != nil {
83			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 18, Col: 60}
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, "\"><script src=\"")
90		if templ_7745c5c3_Err != nil {
91			return templ_7745c5c3_Err
92		}
93		var templ_7745c5c3_Var6 string
94		templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.HTMX)
95		if templ_7745c5c3_Err != nil {
96			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 19, Col: 30}
97		}
98		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(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, "\" defer></script><script src=\"")
103		if templ_7745c5c3_Err != nil {
104			return templ_7745c5c3_Err
105		}
106		var templ_7745c5c3_Var7 string
107		templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.ResolveAttributeValue(l.Assets.Live)
108		if templ_7745c5c3_Err != nil {
109			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 20, Col: 30}
110		}
111		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(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, "\" defer></script><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.SSE)
121		if templ_7745c5c3_Err != nil {
122			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 21, Col: 29}
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.App)
134		if templ_7745c5c3_Err != nil {
135			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 22, Col: 29}
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></head><body data-ref=\"")
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.RefPath)
147		if templ_7745c5c3_Err != nil {
148			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 24, Col: 28}
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, "\" data-sha=\"")
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.SHA)
160		if templ_7745c5c3_Err != nil {
161			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 24, Col: 47}
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, "\" data-sel=\"\" data-nav=\"\"><a class=\"skip\" href=\"#main\">skip to content</a>")
168		if templ_7745c5c3_Err != nil {
169			return templ_7745c5c3_Err
170		}
171		templ_7745c5c3_Err = Header(l).Render(ctx, templ_7745c5c3_Buffer)
172		if templ_7745c5c3_Err != nil {
173			return templ_7745c5c3_Err
174		}
175		var templ_7745c5c3_Var12 = []any{"work", templ.KV("has-rail", l.HasRail && rail != nil)}
176		templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, 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, "<div class=\"")
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(templ.CSSClasses(templ_7745c5c3_Var12).String())
186		if templ_7745c5c3_Err != nil {
187			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 1, Col: 0}
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, "\">")
194		if templ_7745c5c3_Err != nil {
195			return templ_7745c5c3_Err
196		}
197		if l.Lede != "" {
198			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "<section class=\"work-lede\" aria-label=\"Description\"><p class=\"lede\">")
199			if templ_7745c5c3_Err != nil {
200				return templ_7745c5c3_Err
201			}
202			var templ_7745c5c3_Var14 string
203			templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(l.Lede)
204			if templ_7745c5c3_Err != nil {
205				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 29, Col: 81}
206			}
207			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
208			if templ_7745c5c3_Err != nil {
209				return templ_7745c5c3_Err
210			}
211			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "</p></section>")
212			if templ_7745c5c3_Err != nil {
213				return templ_7745c5c3_Err
214			}
215		}
216		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<main id=\"main\" tabindex=\"-1\">")
217		if templ_7745c5c3_Err != nil {
218			return templ_7745c5c3_Err
219		}
220		templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer)
221		if templ_7745c5c3_Err != nil {
222			return templ_7745c5c3_Err
223		}
224		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</main>")
225		if templ_7745c5c3_Err != nil {
226			return templ_7745c5c3_Err
227		}
228		if l.HasRail && rail != nil {
229			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<aside class=\"rail\" aria-label=\"Context\">")
230			if templ_7745c5c3_Err != nil {
231				return templ_7745c5c3_Err
232			}
233			templ_7745c5c3_Err = rail.Render(ctx, templ_7745c5c3_Buffer)
234			if templ_7745c5c3_Err != nil {
235				return templ_7745c5c3_Err
236			}
237			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "</aside>")
238			if templ_7745c5c3_Err != nil {
239				return templ_7745c5c3_Err
240			}
241		}
242		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "</div>")
243		if templ_7745c5c3_Err != nil {
244			return templ_7745c5c3_Err
245		}
246		templ_7745c5c3_Err = Footer(l).Render(ctx, templ_7745c5c3_Buffer)
247		if templ_7745c5c3_Err != nil {
248			return templ_7745c5c3_Err
249		}
250		templ_7745c5c3_Err = Hint(l).Render(ctx, templ_7745c5c3_Buffer)
251		if templ_7745c5c3_Err != nil {
252			return templ_7745c5c3_Err
253		}
254		templ_7745c5c3_Err = OverlayHelp().Render(ctx, templ_7745c5c3_Buffer)
255		if templ_7745c5c3_Err != nil {
256			return templ_7745c5c3_Err
257		}
258		templ_7745c5c3_Err = OverlayRefs(l).Render(ctx, templ_7745c5c3_Buffer)
259		if templ_7745c5c3_Err != nil {
260			return templ_7745c5c3_Err
261		}
262		templ_7745c5c3_Err = OverlayCmd(l.Cmd).Render(ctx, templ_7745c5c3_Buffer)
263		if templ_7745c5c3_Err != nil {
264			return templ_7745c5c3_Err
265		}
266		templ_7745c5c3_Err = Keys().Render(ctx, templ_7745c5c3_Buffer)
267		if templ_7745c5c3_Err != nil {
268			return templ_7745c5c3_Err
269		}
270		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "</body></html>")
271		if templ_7745c5c3_Err != nil {
272			return templ_7745c5c3_Err
273		}
274		return nil
275	})
276}
277
278// Header is the page header: the instance, the path, the ref switcher, the
279// "go to" palette and the owner; inside a repository, the tabs below.
280func Header(l Layout) templ.Component {
281	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
282		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
283		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
284			return templ_7745c5c3_CtxErr
285		}
286		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
287		if !templ_7745c5c3_IsBuffer {
288			defer func() {
289				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
290				if templ_7745c5c3_Err == nil {
291					templ_7745c5c3_Err = templ_7745c5c3_BufErr
292				}
293			}()
294		}
295		ctx = templ.InitializeContext(ctx)
296		templ_7745c5c3_Var15 := templ.GetChildren(ctx)
297		if templ_7745c5c3_Var15 == nil {
298			templ_7745c5c3_Var15 = templ.NopComponent
299		}
300		ctx = templ.ClearChildren(ctx)
301		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "<header class=\"hdr\"><div class=\"hdr-top\"><a class=\"brand\" href=\"/\" data-g=\"h\" title=\"home (g h)\"><span class=\"brand-mark\" aria-hidden=\"true\"></span> <span class=\"brand-name\">")
302		if templ_7745c5c3_Err != nil {
303			return templ_7745c5c3_Err
304		}
305		var templ_7745c5c3_Var16 string
306		templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(l.Instance)
307		if templ_7745c5c3_Err != nil {
308			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 57, Col: 41}
309		}
310		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
311		if templ_7745c5c3_Err != nil {
312			return templ_7745c5c3_Err
313		}
314		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "</span></a> ")
315		if templ_7745c5c3_Err != nil {
316			return templ_7745c5c3_Err
317		}
318		if len(l.Crumbs) > 0 {
319			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "<nav class=\"crumbs\" aria-label=\"Path\"><ol>")
320			if templ_7745c5c3_Err != nil {
321				return templ_7745c5c3_Err
322			}
323			for _, c := range l.Crumbs {
324				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<li>")
325				if templ_7745c5c3_Err != nil {
326					return templ_7745c5c3_Err
327				}
328				if c.Href != "" {
329					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "<a href=\"")
330					if templ_7745c5c3_Err != nil {
331						return templ_7745c5c3_Err
332					}
333					var templ_7745c5c3_Var17 templ.SafeURL
334					templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Href))
335					if templ_7745c5c3_Err != nil {
336						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 66, Col: 38}
337					}
338					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
339					if templ_7745c5c3_Err != nil {
340						return templ_7745c5c3_Err
341					}
342					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "\"")
343					if templ_7745c5c3_Err != nil {
344						return templ_7745c5c3_Err
345					}
346					if c.Current {
347						templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, " aria-current=\"page\"")
348						if templ_7745c5c3_Err != nil {
349							return templ_7745c5c3_Err
350						}
351					}
352					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, ">")
353					if templ_7745c5c3_Err != nil {
354						return templ_7745c5c3_Err
355					}
356					var templ_7745c5c3_Var18 string
357					templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(c.Label)
358					if templ_7745c5c3_Err != nil {
359						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 70, Col: 19}
360					}
361					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
362					if templ_7745c5c3_Err != nil {
363						return templ_7745c5c3_Err
364					}
365					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "</a>")
366					if templ_7745c5c3_Err != nil {
367						return templ_7745c5c3_Err
368					}
369				} else {
370					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "<span")
371					if templ_7745c5c3_Err != nil {
372						return templ_7745c5c3_Err
373					}
374					if c.Current {
375						templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, " aria-current=\"page\"")
376						if templ_7745c5c3_Err != nil {
377							return templ_7745c5c3_Err
378						}
379					}
380					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, ">")
381					if templ_7745c5c3_Err != nil {
382						return templ_7745c5c3_Err
383					}
384					var templ_7745c5c3_Var19 string
385					templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(c.Label)
386					if templ_7745c5c3_Err != nil {
387						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 76, Col: 19}
388					}
389					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
390					if templ_7745c5c3_Err != nil {
391						return templ_7745c5c3_Err
392					}
393					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "</span>")
394					if templ_7745c5c3_Err != nil {
395						return templ_7745c5c3_Err
396					}
397				}
398				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "</li>")
399				if templ_7745c5c3_Err != nil {
400					return templ_7745c5c3_Err
401				}
402			}
403			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "</ol></nav>")
404			if templ_7745c5c3_Err != nil {
405				return templ_7745c5c3_Err
406			}
407		}
408		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "<div class=\"hdr-acts\">")
409		if templ_7745c5c3_Err != nil {
410			return templ_7745c5c3_Err
411		}
412		if l.Ref != "" {
413			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "<button type=\"button\" class=\"btn ref\" aria-haspopup=\"dialog\" aria-controls=\"panel-refs\" aria-keyshortcuts=\"b\" title=\"switch branch or tag (b)\" hx-on:click=\"document.body.dispatchEvent(new CustomEvent('k-refs'))\"><span class=\"ico i-branch\" aria-hidden=\"true\"></span> <span class=\"ref-name\">")
414			if templ_7745c5c3_Err != nil {
415				return templ_7745c5c3_Err
416			}
417			var templ_7745c5c3_Var20 string
418			templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(l.Ref)
419			if templ_7745c5c3_Err != nil {
420				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 95, Col: 36}
421			}
422			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
423			if templ_7745c5c3_Err != nil {
424				return templ_7745c5c3_Err
425			}
426			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "</span> <span class=\"sha\">")
427			if templ_7745c5c3_Err != nil {
428				return templ_7745c5c3_Err
429			}
430			var templ_7745c5c3_Var21 string
431			templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(l.Short)
432			if templ_7745c5c3_Err != nil {
433				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 96, Col: 33}
434			}
435			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
436			if templ_7745c5c3_Err != nil {
437				return templ_7745c5c3_Err
438			}
439			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "</span></button> ")
440			if templ_7745c5c3_Err != nil {
441				return templ_7745c5c3_Err
442			}
443		}
444		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "<button type=\"button\" class=\"btn search\" aria-haspopup=\"dialog\" aria-controls=\"panel-cmd\" aria-keyshortcuts=\"Control+K :\" title=\"go to a section, ref, file or repo (ctrl k or :)\" hx-on:click=\"document.body.dispatchEvent(new CustomEvent('k-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> <button type=\"button\" class=\"btn icon\" aria-haspopup=\"dialog\" aria-controls=\"panel-help\" aria-keyshortcuts=\"?\" aria-label=\"Keyboard shortcuts\" title=\"keyboard shortcuts (?)\" hx-on:click=\"document.body.dispatchEvent(new CustomEvent('k-help'))\">?</button> ")
445		if templ_7745c5c3_Err != nil {
446			return templ_7745c5c3_Err
447		}
448		if SignedIn(ctx) {
449			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "<form class=\"owner\" method=\"post\" action=\"/-/logout\"><span class=\"owner-badge\" title=\"signed in as the owner\">owner</span> <button type=\"submit\" class=\"btn\" title=\"sign out of this browser\">Sign out</button></form>")
450			if templ_7745c5c3_Err != nil {
451				return templ_7745c5c3_Err
452			}
453		}
454		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "</div></div>")
455		if templ_7745c5c3_Err != nil {
456			return templ_7745c5c3_Err
457		}
458		if len(l.Sections) > 0 {
459			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "<nav class=\"tabs\" aria-label=\"Sections\"><ul>")
460			if templ_7745c5c3_Err != nil {
461				return templ_7745c5c3_Err
462			}
463			for _, s := range l.Sections {
464				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "<li><a href=\"")
465				if templ_7745c5c3_Err != nil {
466					return templ_7745c5c3_Err
467				}
468				var templ_7745c5c3_Var22 templ.SafeURL
469				templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(s.Href))
470				if templ_7745c5c3_Err != nil {
471					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 127, Col: 36}
472				}
473				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
474				if templ_7745c5c3_Err != nil {
475					return templ_7745c5c3_Err
476				}
477				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "\" data-key=\"")
478				if templ_7745c5c3_Err != nil {
479					return templ_7745c5c3_Err
480				}
481				var templ_7745c5c3_Var23 string
482				templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.ResolveAttributeValue(s.Key)
483				if templ_7745c5c3_Err != nil {
484					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 128, Col: 24}
485				}
486				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var23)
487				if templ_7745c5c3_Err != nil {
488					return templ_7745c5c3_Err
489				}
490				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "\" aria-keyshortcuts=\"")
491				if templ_7745c5c3_Err != nil {
492					return templ_7745c5c3_Err
493				}
494				var templ_7745c5c3_Var24 string
495				templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.ResolveAttributeValue(s.Key)
496				if templ_7745c5c3_Err != nil {
497					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 129, Col: 33}
498				}
499				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24)
500				if templ_7745c5c3_Err != nil {
501					return templ_7745c5c3_Err
502				}
503				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "\"")
504				if templ_7745c5c3_Err != nil {
505					return templ_7745c5c3_Err
506				}
507				if s.Current {
508					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, " aria-current=\"page\"")
509					if templ_7745c5c3_Err != nil {
510						return templ_7745c5c3_Err
511					}
512				}
513				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, ">")
514				if templ_7745c5c3_Err != nil {
515					return templ_7745c5c3_Err
516				}
517				var templ_7745c5c3_Var25 string
518				templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(s.Label)
519				if templ_7745c5c3_Err != nil {
520					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 133, Col: 17}
521				}
522				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
523				if templ_7745c5c3_Err != nil {
524					return templ_7745c5c3_Err
525				}
526				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "<kbd aria-hidden=\"true\">")
527				if templ_7745c5c3_Err != nil {
528					return templ_7745c5c3_Err
529				}
530				var templ_7745c5c3_Var26 string
531				templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(s.Key)
532				if templ_7745c5c3_Err != nil {
533					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 133, Col: 50}
534				}
535				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
536				if templ_7745c5c3_Err != nil {
537					return templ_7745c5c3_Err
538				}
539				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "</kbd></a></li>")
540				if templ_7745c5c3_Err != nil {
541					return templ_7745c5c3_Err
542				}
543			}
544			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "</ul></nav>")
545			if templ_7745c5c3_Err != nil {
546				return templ_7745c5c3_Err
547			}
548		}
549		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "</header>")
550		if templ_7745c5c3_Err != nil {
551			return templ_7745c5c3_Err
552		}
553		return nil
554	})
555}
556
557// Footer is the version and the link to the source of the running version,
558// which the AGPL §13 asks every user of the service to be offered.
559func Footer(l Layout) templ.Component {
560	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
561		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
562		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
563			return templ_7745c5c3_CtxErr
564		}
565		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
566		if !templ_7745c5c3_IsBuffer {
567			defer func() {
568				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
569				if templ_7745c5c3_Err == nil {
570					templ_7745c5c3_Err = templ_7745c5c3_BufErr
571				}
572			}()
573		}
574		ctx = templ.InitializeContext(ctx)
575		templ_7745c5c3_Var27 := templ.GetChildren(ctx)
576		if templ_7745c5c3_Var27 == nil {
577			templ_7745c5c3_Var27 = templ.NopComponent
578		}
579		ctx = templ.ClearChildren(ctx)
580		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "<footer class=\"foot\"><span>ermite ")
581		if templ_7745c5c3_Err != nil {
582			return templ_7745c5c3_Err
583		}
584		var templ_7745c5c3_Var28 string
585		templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(l.Version)
586		if templ_7745c5c3_Err != nil {
587			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 146, Col: 26}
588		}
589		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
590		if templ_7745c5c3_Err != nil {
591			return templ_7745c5c3_Err
592		}
593		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "</span> <a href=\"")
594		if templ_7745c5c3_Err != nil {
595			return templ_7745c5c3_Err
596		}
597		var templ_7745c5c3_Var29 templ.SafeURL
598		templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(l.SourceURL))
599		if templ_7745c5c3_Err != nil {
600			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/shell.templ`, Line: 147, Col: 38}
601		}
602		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
603		if templ_7745c5c3_Err != nil {
604			return templ_7745c5c3_Err
605		}
606		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "\" rel=\"noopener\" title=\"source of this version (AGPL-3.0-or-later)\">source</a> <span class=\"foot-keys\"><kbd>?</kbd> keyboard shortcuts</span></footer>")
607		if templ_7745c5c3_Err != nil {
608			return templ_7745c5c3_Err
609		}
610		return nil
611	})
612}
613
614// Hint is the floating badge at the bottom right. It shows only what the
615// keyboard just did or what needs attention: the row position while j/k
616// move, the selected lines of a file, a flash message (permalink copied) and
617// a lost event stream. Empty, it takes no room.
618func Hint(l Layout) templ.Component {
619	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
620		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
621		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
622			return templ_7745c5c3_CtxErr
623		}
624		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
625		if !templ_7745c5c3_IsBuffer {
626			defer func() {
627				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
628				if templ_7745c5c3_Err == nil {
629					templ_7745c5c3_Err = templ_7745c5c3_BufErr
630				}
631			}()
632		}
633		ctx = templ.InitializeContext(ctx)
634		templ_7745c5c3_Var30 := templ.GetChildren(ctx)
635		if templ_7745c5c3_Var30 == nil {
636			templ_7745c5c3_Var30 = templ.NopComponent
637		}
638		ctx = templ.ClearChildren(ctx)
639		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "<div class=\"hint\" role=\"status\" aria-live=\"polite\"><span class=\"hint-nav\" :text=\"document.body.dataset.nav || ''\"></span> <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>")
640		if templ_7745c5c3_Err != nil {
641			return templ_7745c5c3_Err
642		}
643		templ_7745c5c3_Err = Live(l).Render(ctx, templ_7745c5c3_Buffer)
644		if templ_7745c5c3_Err != nil {
645			return templ_7745c5c3_Err
646		}
647		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "</div>")
648		if templ_7745c5c3_Err != nil {
649			return templ_7745c5c3_Err
650		}
651		return nil
652	})
653}
654
655var _ = templruntime.GeneratedTemplate

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 4

Tags 45

↑↓ moveenter openesc close