File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ dl .field-list {
2+ display : grid;
3+ grid-template-columns : fit-content (30% ) auto;
4+ }
5+
6+ dl .field-list > dt {
7+ font-weight : bold;
8+ word-break : break-word;
9+ padding-left : 0.5em ;
10+ padding-right : 5px ;
11+ }
12+
13+ dl .field-list > dd {
14+ padding-left : 0.5em ;
15+ margin-top : 0em ;
16+ margin-left : 0em ;
17+ margin-bottom : 0em ;
18+ }
Original file line number Diff line number Diff line change 1+ < dl class ="field-list ">
2+ {{ range $i, $entry := .entries }}
3+ {{if (modBool $i 2)}}
4+ < dt class ="field-odd "> {{ .term }}< span class ="colon "> :</ span > </ dt >
5+ < dd class ="field-odd "> {{ .def }}</ dd >
6+ {{else}}
7+ < dt class ="field-even "> {{ .term }}< span class ="colon "> :</ span > </ dt >
8+ < dd class ="field-even "> {{ .def }}</ dd >
9+ {{end}}
10+ {{end}}
11+ </ dl >
Original file line number Diff line number Diff line change 1+ {{/*
2+
3+ doc: Field lists
4+
5+ {{< field-list > }}
6+ [[entry]]
7+ term = "John"
8+ def = 30
9+
10+ [[entry]]
11+ term = "Will"
12+ def = 28
13+
14+ [[entry]]
15+ term = "Joey"
16+ def = 24
17+ {{< /field-list > }}
18+
19+ */}}
20+
21+ {{ $entries := (index (.Inner | transform.Unmarshal) "entry") }}
22+ {{ partial "_elements/field-list" (dict "ctx" . "entries" $entries) }}
You can’t perform that action at this time.
0 commit comments