aboutsummaryrefslogtreecommitdiff
path: root/templates/shortcodes/showdata.html
diff options
context:
space:
mode:
authorJieiku2023-09-20 00:25:21 -0700
committerJieiku2023-09-20 00:25:21 -0700
commit08f406c44c861a914c8b63fab454250f8a4c4b36 (patch)
treea636aa28e60b6b110138b378996ee2523c1e7bf0 /templates/shortcodes/showdata.html
parentb1be7cc6de3737ebbb1ae1485652e32a2888dbfc (diff)
downloadabridge-08f406c44c861a914c8b63fab454250f8a4c4b36.tar.gz
abridge-08f406c44c861a914c8b63fab454250f8a4c4b36.tar.bz2
abridge-08f406c44c861a914c8b63fab454250f8a4c4b36.zip
refactor nav, blocks, macros, templates. fix image shortcodes
Diffstat (limited to 'templates/shortcodes/showdata.html')
-rw-r--r--templates/shortcodes/showdata.html10
1 files changed, 10 insertions, 0 deletions
diff --git a/templates/shortcodes/showdata.html b/templates/shortcodes/showdata.html
index 9c14444..7f3d3bc 100644
--- a/templates/shortcodes/showdata.html
+++ b/templates/shortcodes/showdata.html
@@ -1,3 +1,5 @@
+{# showdata(src="../theme.toml" type="toml" key="min_version") #}
+
{%- if src and key and type %}
{%- if src is matching("^http[s]?://") %}
{% set data = load_data(url=src, format=type) %}
@@ -5,4 +7,12 @@
{% set data = load_data(path=src, format=type) %}
{%- endif %}
{{ data[key] }}
+{%- else %}
+ {# Load other file types as plain text #}
+ {%- if src is matching("^http[s]?://") %}
+ {% set data = load_data(url=src) %}
+ {%- else %}
+ {% set data = load_data(path=src) %}
+ {%- endif %}
+ {{ data }}
{%- endif %}