forked from deepStateMirrors/tabi
✨ feat(shortcodes): add remote_text shortcode (#305)
This commit is contained in:
parent
be9458cfad
commit
5bc593b676
4 changed files with 88 additions and 3 deletions
7
templates/shortcodes/remote_text.html
Normal file
7
templates/shortcodes/remote_text.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{#- load_data uses different arguments based on whether it's a remote or local file -#}
|
||||
{%- if src is starting_with("http") -%}
|
||||
{%- set response = load_data(url=src, format="plain") -%}
|
||||
{%- else -%}
|
||||
{%- set response = load_data(path=src, format="plain") -%}
|
||||
{%- endif -%}
|
||||
{{- response | trim_end | safe -}}
|
Loading…
Add table
Add a link
Reference in a new issue