Skip to content

Commit f319b9a

Browse files
Document figures (#508)
1 parent aebb6fd commit f319b9a

3 files changed

Lines changed: 37 additions & 10 deletions

File tree

assets/theme-css/styles.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ object.align-center {
3535
margin-right: auto;
3636
}
3737

38-
img.align-default,
39-
figure.align-default,
40-
.figure.align-default {
38+
img,
39+
figure,
40+
.figure {
4141
display: block;
4242
margin-left: auto;
4343
margin-right: auto;
44+
text-align: center;
4445
}
4546

4647
.align-left {

doc/content/features.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,16 @@ By default, `javaScript` points to the server at
116116
`https://views.scientific-python.org`. Contact the Scientific
117117
Python team to have your analytics hosted there.
118118

119+
## Figures
120+
121+
{{< figure src="https://source.unsplash.com/200x200/daily?cute+puppy"
122+
alt="Cute puppies"
123+
target="https://unsplash.com/"
124+
caption="Cute puppies"
125+
loading="lazy"
126+
height=200
127+
width=200 >}}
128+
119129
## Icons
120130

121131
You can add custom icons (for use in, e.g., the footer) by downloading Material-UI SVGs from [Google Fonts](https://fonts.google.com/icons) to the `/assets/icons` directory.

layouts/shortcodes/grid1.html

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

33
doc: Grids.
44

5-
{{< grid1 columns="1 2 2 3">}}
5+
{{< grid1 columns="1 2 2 4">}}
66

77
[[card]]
88
title = 'Only title'
@@ -33,7 +33,13 @@
3333
'''
3434

3535
[[card]]
36-
header = 'A clickable card'
36+
header = 'Header'
37+
title = 'Card Title'
38+
body = 'Card content'
39+
footer = 'Footer'
40+
41+
[[card]]
42+
header = 'A clickable image card'
3743
link = 'https://example.com'
3844
body = '''{{< image >}}
3945
src = 'https://source.unsplash.com/200x200/daily?cute+puppy'
@@ -42,10 +48,20 @@
4248
{{< /image >}}'''
4349

4450
[[card]]
45-
header = 'Header'
46-
title = 'Card Title'
47-
body = 'Card content'
48-
footer = 'Footer'
51+
header = 'A clickable figure card'
52+
link = 'https://example.com'
53+
body = '''{{< figure
54+
src="https://source.unsplash.com/200x200/daily?cute+puppy"
55+
alt="Cute puppies"
56+
>}}'''
57+
58+
[[card]]
59+
link = 'https://example.com'
60+
body = '''{{< figure
61+
src="https://source.unsplash.com/200x200/daily?cute+puppy"
62+
alt="Cute puppies"
63+
caption="Cute puppies"
64+
>}}'''
4965

5066
{{< /grid1 >}}
5167

@@ -60,7 +76,7 @@
6076
{{ $lg := index $columns 3 }}
6177
<div class="sd-row sd-row-cols-1 sd-row-cols-xs-{{ $xs }} sd-row-cols-sm-{{ $sm }} sd-row-cols-md-{{ $md }} sd-row-cols-lg-{{ $lg }} sd-g-2 sd-g-xs-{{ $xs }} sd-g-sm-{{ $sm }} sd-g-md-{{ $md }} sd-g-lg-{{ $lg }}">
6278
{{- else }}
63-
<div class="sd-row">
79+
<div class="sd-row sd-row-cols-auto sd-row-cols-xs-auto sd-row-cols-sm-auto sd-row-cols-md-auto sd-row-cols-lg-auto">
6480
{{- end }}
6581
{{ $cards := (index (.Inner | transform.Unmarshal) "card") }}
6682
{{- range $key, $d := $cards -}}

0 commit comments

Comments
 (0)