|
1 | 1 | {{ $page := . }} |
2 | 2 | {{ $isSpec := eq (len (findRE "^spec-\\d*" .File.ContentBaseName)) 1 }} |
3 | | -<div class="spec-meta"> |
4 | | - <table> |
| 3 | +<div class="sd-card sd-mb-3 sd-shadow-sm"> |
| 4 | +<div class="sd-card-body"> |
5 | 5 | {{ $meta_fields := (slice "author" "discussion" "history" "endorsed-by") }} |
| 6 | + {{ $warn := "" }} |
| 7 | + <dl class="field-list"> |
6 | 8 | {{- range $attr := $meta_fields -}} |
7 | 9 | {{ $val := index $.Params $attr }} |
8 | 10 | {{ $attr := strings.TrimPrefix "spec_" $attr }} |
|
20 | 22 | {{- end -}} |
21 | 23 | {{ $isSpecField := (in (slice "endorsed-by" "discussion" ) $attr) }} |
22 | 24 | {{ if (or $isSpec (not $isSpecField)) }} |
23 | | - <tr class="field"> |
24 | | - <td class="field-name"> |
25 | | - {{ $attr | humanize }}: |
26 | | - </td> |
| 25 | + <dt class="field-odd"> |
| 26 | + {{ $attr | humanize }}<span class="colon">:</span></dt> |
| 27 | + </dt> |
27 | 28 | {{- if (reflect.IsSlice $val) -}} |
28 | 29 | {{ $len := len $val }} |
29 | | - <td class="field-value"> |
| 30 | + <dd class="field-odd"> |
30 | 31 | {{- range $idx, $el := $val }} |
31 | 32 | {{ if eq $attr "endorsed-by" }} |
32 | 33 | <a href="{{ relref $.Page.CurrentSection (printf "core-projects/%s" $el) }}">{{ $el }}</a> |
|
35 | 36 | {{- end -}} |
36 | 37 | {{- if not (eq (add $idx 1) $len) -}},{{ end }} |
37 | 38 | {{ end }} |
38 | | - </td> |
| 39 | + </dd> |
39 | 40 | {{- else }} |
40 | | - <td class="field-value"> |
| 41 | + <dd class="field-odd"> |
41 | 42 | {{ $val | markdownify }} |
42 | | - </td> |
| 43 | + </dd> |
43 | 44 | {{- end -}} |
44 | | - </tr> |
45 | | - {{/* add warning that this is a draft, i.e. has not been endorsed by 2 projects or more */}} |
46 | | - {{- if (and (eq $attr "endorsed-by") (lt (len (or $val "")) 2)) }} |
47 | | - {{/* add blank line */}} |
48 | | - <tr class="field"> |
49 | | - <td class="field-name"> </td> |
50 | | - <td class="field-value"></td> |
51 | | - </tr> |
52 | | - {{/* add warning */}} |
53 | | - <tr class="field" style="background-color:crimson;color:white;"> |
54 | | - <td class="field-name"> |
55 | | - WARNING: |
56 | | - </td> |
57 | | - <td class="field-value"> |
58 | | - Draft document. |
59 | | - </td> |
60 | | - </div> |
61 | | - {{- end -}} |
62 | 45 | {{- end -}} |
| 46 | + {{/* add warning that this is a draft, i.e. has not been endorsed by 2 projects or more */}} |
| 47 | + {{- if (and (eq $attr "endorsed-by") (lt (len (or $val "")) 2)) -}} |
| 48 | + {{ $warn = "True" }} |
| 49 | + {{- end -}} |
63 | 50 | {{- end -}} |
64 | | - </table> |
| 51 | + </dl> |
| 52 | + {{- if $warn }} |
| 53 | + <div class="admonition attention"> |
| 54 | + <div class="admonition-title"> |
| 55 | + Attention |
| 56 | + </div> |
| 57 | + <p>This is a draft document.</p> |
| 58 | + </div> |
| 59 | + {{- end -}} |
| 60 | +</div> |
65 | 61 | </div> |
0 commit comments