summaryrefslogtreecommitdiffstats
path: root/tpl/objects/card.pug
blob: d6516be5a4aa690f8bc0d5261652865cfe27f422 (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
mixin card
    - const slots = {}

    mixin slot(key)
        - slots[key] = block

    -
        block ? block() : undefined 

        let classes = {
            'o-card': true,
        }

    if attributes.href
        a(href=attributes.href class=classes)
            if slots.body
                .o-card__body
                    - slots.body()
            if slots.footer
                .o-card__footer
                    - slots.footer()
    else
        div(class=classes)
            if slots.body
                .o-card__body
                    - slots.body()
            if slots.footer
                .o-card__footer
                    - slots.footer()