aboutsummaryrefslogtreecommitdiff
path: root/templates/shortcodes
diff options
context:
space:
mode:
Diffstat (limited to 'templates/shortcodes')
-rw-r--r--templates/shortcodes/img.html2
-rw-r--r--templates/shortcodes/imgswap.html4
-rw-r--r--templates/shortcodes/showdata.html8
3 files changed, 11 insertions, 3 deletions
diff --git a/templates/shortcodes/img.html b/templates/shortcodes/img.html
index d599ba0..f5754ce 100644
--- a/templates/shortcodes/img.html
+++ b/templates/shortcodes/img.html
@@ -27,7 +27,7 @@
{%- endif %}
{%- else %} {# Same Directory Path #}
- {%- set path = page.path %}
+ {%- set path = "" %}
{%- if not w or not h %}
{%- if lang != config.default_language %}
{%- set metapath = page.path ~ img | replace(from=page.path | truncate(length=4, end=""), to="/") %}
diff --git a/templates/shortcodes/imgswap.html b/templates/shortcodes/imgswap.html
index 607febb..efcf6e7 100644
--- a/templates/shortcodes/imgswap.html
+++ b/templates/shortcodes/imgswap.html
@@ -28,7 +28,7 @@
{%- endif %}
{%- else %} {# Same Directory Path #}
- {%- set path = page.path %}
+ {%- set path = "" %}
{%- if not w or not h %}
{%- if lang != config.default_language %}
{%- set metapath = page.path ~ img | replace(from=page.path | truncate(length=4, end=""), to="/") %}
@@ -75,7 +75,7 @@
{%- endif %}
{%- else %} {# Same Directory Path #}
- {%- set path = page.path %}
+ {%- set path = "" %}
{%- if not w or not h %}
{%- if lang != config.default_language %}
{%- set metapath = page.path ~ img | replace(from=page.path | truncate(length=4, end=""), to="/") %}
diff --git a/templates/shortcodes/showdata.html b/templates/shortcodes/showdata.html
new file mode 100644
index 0000000..9c14444
--- /dev/null
+++ b/templates/shortcodes/showdata.html
@@ -0,0 +1,8 @@
+{%- if src and key and type %}
+ {%- if src is matching("^http[s]?://") %}
+ {% set data = load_data(url=src, format=type) %}
+ {%- else %}
+ {% set data = load_data(path=src, format=type) %}
+ {%- endif %}
+ {{ data[key] }}
+{%- endif %}