✨ feat: add raw_path
parameter to image shortcodes (#439)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{#- Determine image path based on whether the src is remote or local -#}
|
||||
{%- if src is starting_with("http") -%}
|
||||
{%- if src is starting_with("http") or raw_path -%}
|
||||
{%- set image_url = src -%}
|
||||
{%- else -%}
|
||||
{%- set colocated_path = page.colocated_path | default(value="") -%}
|
||||
|
@@ -10,7 +10,7 @@
|
||||
{%- endif -%}
|
||||
|
||||
{# Handling for light mode image #}
|
||||
{%- if light_src is starting_with("http") -%}
|
||||
{%- if light_src is starting_with("http") or raw_path -%}
|
||||
{%- set light_image_url = light_src -%}
|
||||
{%- else -%}
|
||||
{%- set relative_light_path = colocated_path ~ light_src -%}
|
||||
@@ -23,7 +23,7 @@
|
||||
{%- endif -%}
|
||||
|
||||
{# Handling for dark mode image #}
|
||||
{%- if dark_src is starting_with("http") -%}
|
||||
{%- if dark_src is starting_with("http") or raw_path -%}
|
||||
{%- set dark_image_url = dark_src -%}
|
||||
{%- else -%}
|
||||
{%- set relative_dark_path = colocated_path ~ dark_src -%}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{#- Set paths based on whether the src is remote or local -#}
|
||||
{%- if src is starting_with("http") -%}
|
||||
{%- if src is starting_with("http") or raw_path -%}
|
||||
{%- set image_url = src -%}
|
||||
{%- else -%}
|
||||
{%- set colocated_path = page.colocated_path | default(value="") -%}
|
||||
|
@@ -15,7 +15,7 @@
|
||||
{%- endif -%}
|
||||
|
||||
{#- Direct or relative URL handling for default image -#}
|
||||
{%- if default_src is starting_with("http") -%}
|
||||
{%- if default_src is starting_with("http") or raw_path -%}
|
||||
{%- set default_image_url = default_src -%}
|
||||
{%- else -%}
|
||||
{%- set relative_default_path = colocated_path ~ default_src -%}
|
||||
@@ -28,7 +28,7 @@
|
||||
{%- endif -%}
|
||||
|
||||
{#- Direct or relative URL handling for hovered image -#}
|
||||
{%- if hovered_src is starting_with("http") -%}
|
||||
{%- if hovered_src is starting_with("http") or raw_path -%}
|
||||
{%- set hovered_image_url = hovered_src -%}
|
||||
{%- else -%}
|
||||
{%- set relative_hovered_path = colocated_path ~ hovered_src -%}
|
||||
|
@@ -19,7 +19,7 @@
|
||||
{%- endif -%}
|
||||
|
||||
{# Direct or relative URL handling for default image #}
|
||||
{%- if default_src is starting_with("http") -%}
|
||||
{%- if default_src is starting_with("http") or raw_path -%}
|
||||
{%- set default_image_url = default_src -%}
|
||||
{%- else -%}
|
||||
{%- set relative_default_path = colocated_path ~ default_src -%}
|
||||
@@ -32,7 +32,7 @@
|
||||
{%- endif -%}
|
||||
|
||||
{# Direct or relative URL handling for toggled image #}
|
||||
{%- if toggled_src is starting_with("http") -%}
|
||||
{%- if toggled_src is starting_with("http") or raw_path -%}
|
||||
{%- set toggled_image_url = toggled_src -%}
|
||||
{%- else -%}
|
||||
{%- set relative_toggled_path = colocated_path ~ toggled_src -%}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{#- Determine if src is a remote URL or a local path -#}
|
||||
{%- if src is starting_with("http") -%}
|
||||
{%- if src is starting_with("http") or raw_path -%}
|
||||
{%- set image_url = src -%}
|
||||
{%- else -%}
|
||||
{%- set colocated_path = page.colocated_path | default(value="") -%}
|
||||
|
Reference in New Issue
Block a user