feat: add raw_path parameter to image shortcodes (#439)

This commit is contained in:
Óscar
2024-11-27 21:34:42 +01:00
committed by GitHub
parent 180fc53384
commit f8e98afd9d
9 changed files with 18 additions and 15 deletions

View File

@@ -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="") -%}

View File

@@ -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 -%}

View File

@@ -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="") -%}

View File

@@ -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 -%}

View File

@@ -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 -%}

View File

@@ -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="") -%}