aboutsummaryrefslogtreecommitdiff
path: root/templates/shortcodes
diff options
context:
space:
mode:
authorJieiku2023-05-01 15:08:23 -0700
committerJieiku2023-05-22 22:49:42 -0700
commit6c5915c04659a992635742074b2ad92d3e97a9df (patch)
treed31cb3507154c55be0ce7156664849341e3a2909 /templates/shortcodes
parent1010c41b8ac22e7e69177e0d02e034896fb9eadb (diff)
downloadabridge-6c5915c04659a992635742074b2ad92d3e97a9df.tar.gz
abridge-6c5915c04659a992635742074b2ad92d3e97a9df.tar.bz2
abridge-6c5915c04659a992635742074b2ad92d3e97a9df.zip
Replace import with use
Diffstat (limited to 'templates/shortcodes')
-rw-r--r--templates/shortcodes/note.html30
1 files changed, 30 insertions, 0 deletions
diff --git a/templates/shortcodes/note.html b/templates/shortcodes/note.html
new file mode 100644
index 0000000..b2420e9
--- /dev/null
+++ b/templates/shortcodes/note.html
@@ -0,0 +1,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>