main pico / pkg / apps / prose / html / list.partial.tmpl
Eric Bower  ·  2026-10-03
 1{{define "list"}}
 2	{{$indent := 0}}
 3	{{$mod := 0}}
 4
 5	<ul>
 6		{{range .Items}}
 7	    {{if lt $indent .Indent}}
 8	    	<ul>
 9	    {{else if gt $indent .Indent}}
10	    	{{$mod = minus $indent .Indent}}
11	    	{{range $y := intRange 1 $mod}}
12	    		</ul>
13	    	{{end}}
14	    {{end}}
15
16	    {{$indent = .Indent}}
17
18			{{if .IsText}}
19				<li>{{.Value}}</li>
20			{{end}}
21
22			{{if .IsURL}}
23				<li><a href="{{.URL}}">{{.Value}}</a></li>
24			{{end}}
25
26	    {{if .IsImg}}
27	    	<li><img src="{{.URL}}" alt="{{.Value}}" /></li>
28	    {{end}}
29
30	    {{if .IsBlock}}
31	    	<li><blockquote>{{.Value}}</blockquote></li>
32	    {{end}}
33
34	    {{if .IsPre}}
35	    	<li><pre>{{.Value}}</pre></li>
36	    {{end}}
37
38	    {{if .IsHeaderOne}}
39	    	</ul>
40	    	<h2>{{.Value}}</h2>
41	    	<ul>
42	    {{end}}
43
44	    {{if .IsHeaderTwo}}
45	    	</ul>
46	    	<h3>{{.Value}}</h3>
47	    	<ul>
48	    {{end}}
49
50	    {{if .IsHr}}
51	    	</ul>
52	    	<hr />
53	    	<ul>
54	    {{end}}
55		{{end}}
56		{{if gt $indent 0}}
57			{{range $y := intRange 1 $indent}}
58				</ul>
59			{{end}}
60		{{end}}
61	</ul>
62{{end}}