aboutsummaryrefslogtreecommitdiff
path: root/templates/shortcodes/note.html
blob: b2420e9ac18b29989f805258448ff0b52dcc26c7 (plain)
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
30
{#  note shortcode with icon and border

    type: ok / info / warning / error / neutral / other
    display: block / icon / both
    size: small / medium / large
    markdown: true / false

    example:

    {% note(type="ok", display="block", size="small" markdown=true) %}
    *Sample* "ok" note. With display "block"
    And **markdown** content.
    {% end %}
#}

{# define defaults #}
{% if not type %}{% set type="neutral" %}{% endif %}
{% if not display %}{% set display="block" %}{% endif %}
{% if not size %}{% set size="small" %}{% endif %}
{% if not markdown %}{% set markdown=true %}{% endif %}

<div class="note
{%- if display == 'icon' %} note-icon note-icon-{{size}} note-icon-{{type}}
{%- elif display == 'block' %} note-block note-{{type}}
{%- elif display == 'both' %} note-icon note-icon-{{size}} note-icon-{{type}} note-block note-{{type}}
{%- endif %}">
{% if markdown %}{{ body | markdown | safe }}
{% else %}{{ body | safe }}
{% endif %}
</div>