summaryrefslogtreecommitdiffstats
path: root/lib/partials/figure.p
blob: f853c96b5186828c3f3569d729cdc698bb9a9435 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
@USE
picture.p

@figure[images;default_type;.caption;.alt;.height;.href]
^if(def $alt){
    $resolved_alt[$alt]
}(def $caption){
    $resolved_alt[$caption]
}

<figure class="figure">
# HACK боже какое оно вонючее
    ^if(def $href){
        <a href="$href">
    }
    ^picture[$images;$default_type;
        $.alt[$resolved_alt]
        $.height[$height]
        $.class[image]
    ]
    ^if(def $href){
        </a>
    }

    ^if(def $caption){
        <figcaption class="caption">$caption</figcaption>
    }
</figure>
#end @figure[]