File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323'''
2424{{< /card > }}
2525
26+ {{< card > }}
27+ title = 'A card with a dropdown menu'
28+ body = '''
29+ {{< dropdown > }}
30+ title = 'Click to expand dropdown'
31+ icon = 'eye'
32+ body = 'Hidden content'
33+ {{< /dropdown > }}
34+ '''
35+ {{< /card > }}
36+
2637{{< card > }}
2738title = 'A clickable card'
2839link = 'https://example.com'
Original file line number Diff line number Diff line change 3434*/}}
3535
3636{{- $data := .Inner | transform.Unmarshal -}}
37-
3837< details class ="sd-card sd-dropdown sd-mb-3 ">
39- {{ with $data.color }}
38+ {{- with $data.color }}
4039 < summary class ="sd-summary-title sd-card-header sd-bg-{{ . }} sd-bg-text-{{ . }} ">
41- {{ else }}
40+ {{- else }}
4241 < summary class ="sd-summary-title sd-card-header ">
43- {{ end }}
44- {{ with $data.icon }}
42+ {{- end }}
43+ {{- with $data.icon }}
4544 < span class ="sd-summary-icon "> < svg version ="1.1 " width ="1.0em " height ="1.0em " class ="sd-octicon sd-octicon-{{ . }} " viewBox ="0 0 16 16 " aria-hidden ="true "> < path fill-rule ="evenodd " d ="M5.5 4a2.5 2.5 0 014.607-1.346.75.75 0 101.264-.808A4 4 0 004 4v2h-.501A1.5 1.5 0 002 7.5v6A1.5 1.5 0 003.5 15h9a1.5 1.5 0 001.5-1.5v-6A1.5 1.5 0 0012.5 6h-7V4zm-.75 3.5H3.5v6h9v-6H4.75z "> </ path > </ svg > </ span >
46- {{ end }}
47- {{ with $data.title }}
48- {{ . }}
49- {{ else }}
45+ {{- end }}
46+ {{- with $data.title }}
47+ {{- . }}
48+ {{- else }}
5049 < svg version ="1.1 " width ="1.5em " height ="1.5em " class ="sd-octicon sd-octicon-kebab-horizontal " viewBox ="0 0 24 24 " aria-hidden ="true "> < path fill-rule ="evenodd " d ="M6 12a2 2 0 11-4 0 2 2 0 014 0zm8 0a2 2 0 11-4 0 2 2 0 014 0zm6 2a2 2 0 100-4 2 2 0 000 4z "> </ path > </ svg >
51- {{ end }}
50+ {{- end }}
5251 < div class ="sd-summary-down ">
5352< svg version ="1.1 " width ="1.5em " height ="1.5em " class ="sd-octicon sd-octicon-chevron-down " viewBox ="0 0 24 24 " aria-hidden ="true "> < path fill-rule ="evenodd " d ="M5.22 8.72a.75.75 0 000 1.06l6.25 6.25a.75.75 0 001.06 0l6.25-6.25a.75.75 0 00-1.06-1.06L12 14.44 6.28 8.72a.75.75 0 00-1.06 0z "> </ path > </ svg > </ div >
5453 < div class ="sd-summary-up ">
5554< svg version ="1.1 " width ="1.5em " height ="1.5em " class ="sd-octicon sd-octicon-chevron-up " viewBox ="0 0 24 24 " aria-hidden ="true "> < path fill-rule ="evenodd " d ="M18.78 15.28a.75.75 0 000-1.06l-6.25-6.25a.75.75 0 00-1.06 0l-6.25 6.25a.75.75 0 101.06 1.06L12 9.56l5.72 5.72a.75.75 0 001.06 0z "> </ path > </ svg > </ div >
5655 </ summary >
57-
5856 < div class ="sd-summary-content sd-card-body ">
59- {{ with (trim $data.body "\n") }}
60- {{ . | markdownify }}
61- {{ end }}
57+ {{- with (trim $data.body "\n") }}
58+ {{- . | markdownify }}
59+ {{- end }}
6260 </ div >
6361</ details >
You can’t perform that action at this time.
0 commit comments