feat(shortcodes): add remote_text shortcode (#305)

This commit is contained in:
Óscar 2024-05-02 22:57:56 +02:00 committed by GitHub
parent be9458cfad
commit 5bc593b676
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 88 additions and 3 deletions

View 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 -}}