Skip to content

Commit ac77059

Browse files
committed
Move figure, image, dropdown and button to be inline shortcodes only
1 parent 45be580 commit ac77059

File tree

11 files changed

+265
-294
lines changed

11 files changed

+265
-294
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ public
99

1010
# vim droppings
1111
.*.swp
12+
13+
.DS_Store

doc/content/about/theme-team.toml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
11
[[item]]
22
type = 'card'
33
classcard = 'text-center'
4-
body = '''{{< image >}}
5-
src = 'https://avatars.githubusercontent.com/u/601365?v=4"'
6-
alt = 'Avatar of Adam Porter'
7-
{{< /image >}}
8-
Adam Porter'''
4+
body = '''
5+
{{< image
6+
src='https://avatars.githubusercontent.com/u/601365?v=4"'
7+
alt="Avatar of Adam Porter" >}}
8+
Adam Porter
9+
'''
910
link = 'https://github.com/alphapapa'
1011

1112
[[item]]
1213
type = 'card'
1314
classcard = 'text-center'
14-
body = '''{{< image >}}
15-
src = 'https://avatars.githubusercontent.com/u/352264?u=1fd523aa28b0451454989400579d97a8c1bc1b9a&v=4"'
16-
alt = 'Avatar of Brian Hawthorne'
17-
{{< /image >}}
15+
body = '''
16+
{{< image
17+
src='https://avatars.githubusercontent.com/u/352264?u=1fd523aa28b0451454989400579d97a8c1bc1b9a&v=4"'
18+
alt="Avatar of Brian Hawthorne" >}}
1819
Brian Hawthorne'''
1920
link = 'https://github.com/brianhawthorne'
2021

2122
[[item]]
2223
type = 'card'
2324
classcard = 'text-center'
24-
body = '''{{< image >}}
25-
src = 'https://avatars.githubusercontent.com/u/123428?v=4"'
26-
alt = 'Avatar of Jarrod Millman'
27-
{{< /image >}}
25+
body = '''
26+
{{< image
27+
src='https://avatars.githubusercontent.com/u/123428?v=4"'
28+
alt="Avatar of Jarrod Millman" >}}
2829
Jarrod Millman'''
2930
link = 'https://github.com/jarrodmillman'
3031

3132
[[item]]
3233
type = 'card'
3334
classcard = 'text-center'
34-
body = '''{{< image >}}
35-
src = 'https://avatars.githubusercontent.com/u/45071?u=c779b5e06448fbc638bc987cdfe305c7f9a7175e&v=4"'
36-
alt = 'Avatar of Stefan van der Walt'
37-
{{< /image >}}
35+
body = '''
36+
{{< image
37+
src='https://avatars.githubusercontent.com/u/45071?u=c779b5e06448fbc638bc987cdfe305c7f9a7175e&v=4"'
38+
alt="Avatar of Stefan van der Walt" >}}
3839
Stefan van der Walt'''
3940
link = 'https://github.com/stefanv'
4041

4142
[[item]]
4243
type = 'card'
4344
classcard = 'text-center'
44-
body = '''{{< image >}}
45-
src = 'https://avatars.githubusercontent.com/u/23188539?u=64445b52dbf3f75de8006ed4264fdd2afaed97a3&v=4"'
46-
alt = 'Avatar of Pamphile Roy'
47-
{{< /image >}}
45+
body = '''{{< image
46+
src='https://avatars.githubusercontent.com/u/23188539?u=64445b52dbf3f75de8006ed4264fdd2afaed97a3&v=4"'
47+
alt="Avatar of Pamphile Roy" >}}
4848
Pamphile Roy'''
4949
link = 'https://github.com/tupui'

doc/content/user_guide/web-components.md

Lines changed: 52 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -50,40 +50,40 @@ success outline
5050
Here are some of the available button-style links, also using semantic
5151
colors:
5252

53-
{{< button info >}}
54-
label: Info
55-
link: http://example.com/
56-
{{< /button >}}
57-
58-
{{< button success >}}
59-
label: Success
60-
link: http://example.com/
61-
{{< /button >}}
62-
63-
{{< button warning >}}
64-
label: Warning
65-
link: http://example.com/
66-
{{< /button >}}
67-
68-
{{< button danger >}}
69-
label: Danger
70-
link: http://example.com/
71-
{{< /button >}}
72-
73-
{{< button muted >}}
74-
label: Muted
75-
link: http://example.com/
76-
{{< /button >}}
77-
78-
{{< button light >}}
79-
label: Light
80-
link: http://example.com/
81-
{{< /button >}}
82-
83-
{{< button dark >}}
84-
label: Dark
85-
link: http://example.com/
86-
{{< /button >}}
53+
{{< button
54+
style="info"
55+
label="Info"
56+
link="http://example.com/" >}}
57+
58+
{{< button
59+
style="success"
60+
label="Success"
61+
link="http://example.com/" >}}
62+
63+
{{< button
64+
style="warning"
65+
label="Warning"
66+
link="http://example.com/" >}}
67+
68+
{{< button
69+
style="danger"
70+
label="Danger"
71+
link="http://example.com/" >}}
72+
73+
{{< button
74+
style="muted"
75+
label="Muted"
76+
link="http://example.com/" >}}
77+
78+
{{< button
79+
style="light"
80+
label="Light"
81+
link="http://example.com/" >}}
82+
83+
{{< button
84+
style="dark"
85+
label="Dark"
86+
link="http://example.com/" >}}
8787

8888
{{< admonition note >}}
8989
[Sphinx Design
@@ -134,11 +134,10 @@ Content of the third card.
134134
{{< card >}}
135135
title = 'A card with a dropdown menu'
136136
body = '''
137-
{{< dropdown >}}
138-
title = 'Click to expand dropdown'
139-
icon = 'fa-solid fa-eye'
140-
body = 'Hidden content'
141-
{{< /dropdown >}}
137+
{{< dropdown
138+
title="Click to expand dropdown"
139+
icon="fa-solid fa-eye"
140+
body="Hidden content" >}}
142141
'''
143142
{{< /card >}}
144143

@@ -284,32 +283,27 @@ And some admonition content.
284283

285284
{{< dropdown >}}
286285
body = 'And with no title and some content!'
287-
{{< /dropdown >}}
288286

289-
{{< dropdown >}}
290-
title = 'With a title'
291-
body = 'And some content!'
292-
{{< /dropdown >}}
287+
{{< dropdown
288+
title="With a title"
289+
body="And some content!" >}}
293290

294291
{{< dropdown >}}
295-
title = 'With a title and icon'
296-
icon = 'fa-solid fa-lock-open'
297-
body = 'And some content and an icon!'
298-
{{< /dropdown >}}
292+
title="With a title and icon"
293+
icon="fa-solid fa-lock-open"
294+
body="And some content and an icon!" >}}
299295

300296
{{< dropdown >}}
301-
title = 'A primary color dropdown'
302-
icon = 'fa-solid fa-lock-open'
303-
color = 'primary'
304-
body = 'And some content and an icon!'
305-
{{< /dropdown >}}
297+
title="A primary color dropdown"
298+
icon="fa-solid fa-lock-open"
299+
color="primary"
300+
body="And some content and an icon!" >}}
306301

307302
{{< dropdown >}}
308-
title = 'A secondary color dropdown'
309-
icon = 'fa-solid fa-eye'
310-
color = 'secondary'
311-
body = 'And some content and an icon!'
312-
{{< /dropdown >}}
303+
title="A secondary color dropdown"
304+
icon="fa-solid fa-eye"
305+
color="secondary"
306+
body="And some content and an icon!" >}}
313307

314308
## Copybuttons
315309

layouts/shortcodes/button.html

Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -2,83 +2,83 @@
22

33
doc: Create button links in various styles.
44

5-
{{< button info >}}
6-
label: Info
7-
link: http://example.com/
8-
{{< /button >}}
9-
10-
{{< button success >}}
11-
label: Success
12-
link: http://example.com/
13-
{{< /button >}}
14-
15-
{{< button warning >}}
16-
label: Warning
17-
link: http://example.com/
18-
{{< /button >}}
19-
20-
{{< button danger >}}
21-
label: Danger
22-
link: http://example.com/
23-
{{< /button >}}
24-
25-
{{< button muted >}}
26-
label: Muted
27-
link: http://example.com/
28-
{{< /button >}}
29-
30-
{{< button light >}}
31-
label: Light
32-
link: http://example.com/
33-
{{< /button >}}
34-
35-
{{< button dark >}}
36-
label: Dark
37-
link: http://example.com/
38-
{{< /button >}}
5+
{{< button
6+
style="info"
7+
label="Info"
8+
link="http://example.com/" >}}
9+
10+
{{< button
11+
style="success"
12+
label="Success"
13+
link="http://example.com/" >}}
14+
15+
{{< button
16+
style="warning"
17+
label="Warning"
18+
link="http://example.com/" >}}
19+
20+
{{< button
21+
style="danger"
22+
label="Danger"
23+
link="http://example.com/" >}}
24+
25+
{{< button
26+
style="muted"
27+
label="Muted"
28+
link="http://example.com/" >}}
29+
30+
{{< button
31+
style="light"
32+
label="Light"
33+
link="http://example.com/" >}}
34+
35+
{{< button
36+
style="dark"
37+
label="Dark"
38+
link="http://example.com/" >}}
3939

4040
<p>
4141

42-
{{< button outline-info >}}
43-
label: Info
44-
link: http://example.com/
45-
{{< /button >}}
46-
47-
{{< button outline-success >}}
48-
label: Success
49-
link: http://example.com/
50-
{{< /button >}}
51-
52-
{{< button outline-warning >}}
53-
label: Warning
54-
link: http://example.com/
55-
{{< /button >}}
56-
57-
{{< button outline-danger >}}
58-
label: Danger
59-
link: http://example.com/
60-
{{< /button >}}
61-
62-
{{< button outline-muted >}}
63-
label: Muted
64-
link: http://example.com/
65-
{{< /button >}}
66-
67-
{{< button outline-light >}}
68-
label: Light
69-
link: http://example.com/
70-
{{< /button >}}
71-
72-
{{< button outline-dark >}}
73-
label: Dark
74-
link: http://example.com/
75-
{{< /button >}}
42+
{{< button
43+
style="outline-info"
44+
label="Info"
45+
link="http://example.com/" >}}
46+
47+
{{< button
48+
style="outline-success"
49+
label="Success"
50+
link="http://example.com/" >}}
51+
52+
{{< button
53+
style="outline-warning"
54+
label="Warning"
55+
link="http://example.com/" >}}
56+
57+
{{< button
58+
style="outline-danger"
59+
label="Danger"
60+
link="http://example.com/" >}}
61+
62+
{{< button
63+
style="outline-muted"
64+
label="Muted"
65+
link="http://example.com/" >}}
66+
67+
{{< button
68+
style="outline-light"
69+
label="Light"
70+
link="http://example.com/" >}}
71+
72+
{{< button
73+
style="outline-dark"
74+
label="Dark"
75+
link="http://example.com/" >}}
7676

7777
*/}}
7878

79-
{{ $button_style := .Get 0 }}
80-
{{ $button_data := transform.Unmarshal .Inner }}
81-
{{ $button_label := $button_data.label }}
82-
{{ $button_link := $button_data.link }}
79+
{{- $button := dict -}}
80+
{{- range $key, $value := .Params -}}
81+
{{- $button = merge $button (dict $key $value) -}}
82+
{{- end -}}
8383

84-
<a href="{{$button_link}}"><span class="sd-btn sd-btn-{{$button_style}}">{{$button_label}}</span></a>
84+
<a href="{{$button.link}}"><span class="sd-btn sd-btn-{{$button.style}}">{{$button.label}}</span></a>

layouts/shortcodes/card.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@
2626
{{< card >}}
2727
title = 'A card with a dropdown menu'
2828
body = '''
29-
{{< dropdown >}}
30-
title = 'Click to expand dropdown'
31-
icon = 'fa-solid fa-eye'
32-
body = 'Hidden content'
33-
{{< /dropdown >}}
29+
{{< dropdown
30+
title="Click to expand dropdown"
31+
icon="fa-solid fa-eye"
32+
body="Hidden content" >}}
3433
'''
3534
{{< /card >}}
3635

0 commit comments

Comments
 (0)