|
7 | 7 | alt = 'Cute puppies' |
8 | 8 | height = 200 |
9 | 9 | width = 200 |
10 | | -caption = 'A figure is an image with a caption and/or a legend:' |
| 10 | +title = 'Figure title' |
| 11 | +attribution = 'Figure Credits: Daily cute puppy image from unslash.com' |
| 12 | +attributionlink = 'https://source.unsplash.com/200x200/daily?cute+puppy' |
| 13 | +caption = ''' |
| 14 | +A figure is an image with a caption. Figures may also include a tile, legend, and/or attribution. |
| 15 | +''' |
11 | 16 | legend = ''' |
12 | 17 | **TODO: need to convert yamltotable to tomltotable** |
13 | 18 |
|
|
18 | 23 | {{< figure >}} |
19 | 24 | src = 'https://source.unsplash.com/200x200/daily?cute+puppy' |
20 | 25 | alt = 'Cute puppies' |
| 26 | +attribution = 'from unslash.com' |
| 27 | +attributionlink = 'https://source.unsplash.com/200x200/daily?cute+puppy' |
21 | 28 | align = 'left' |
22 | 29 | height = 150 |
23 | 30 | width = 150 |
|
36 | 43 | {{- $align := default "default" $figure.align -}} |
37 | 44 | {{- $id := printf "id%03d" $.Ordinal -}} |
38 | 45 | <figure class="align-{{ $align }}" id="{{ $id }}"> |
39 | | -{{- $m := newScratch -}} |
40 | | -{{- $m.Set "image" $figure -}} |
41 | | -{{- $m.SetInMap "image" "align" "center" -}} |
42 | | -{{ partial "_elements/image.html" (dict "data" $m.Values.image) }} |
| 46 | +{{ partial "_elements/image.html" (dict "data" $figure) }} |
43 | 47 | <figcaption> |
| 48 | +{{- with $figure.title -}} |
| 49 | +<strong class="caption-title">{{ . }}</strong><a class="headerlink" href="#{{ $id }}" title="Link to this image">#</a><br> |
| 50 | +{{- end }} |
| 51 | +{{- if $figure.attribution -}} |
| 52 | +{{- with $figure.attributionlink -}}<a href="{{ . }}">{{- end -}}{{- $figure.attribution -}}{{- if $figure.attributionlink -}}</a>{{- end -}} |
| 53 | +{{- end }} |
44 | 54 | <p><span class="caption-text"> |
45 | 55 | {{- $figure.caption | markdownify -}} |
46 | | -</span><a class="headerlink" href="#{{ $id }}" title="Link to this image">#</a></p> |
| 56 | +</span> |
47 | 57 | {{- with $figure.legend }} |
48 | 58 | <div class="legend"> |
49 | 59 | {{ . | markdownify -}} |
|
0 commit comments