{%- set colocated_path = page.colocated_path | default(value="") -%} {%- set lazy_loading = lazy_loading | default(value=true) -%} {%- set inline = inline | default(value=false) -%} {%- set light_class_list = "img-light" -%} {%- set dark_class_list = "img-dark" -%} {%- if inline -%} {%- set light_class_list = light_class_list ~ " inline" -%} {%- set dark_class_list = dark_class_list ~ " inline" -%} {%- endif -%} {# Handling for light mode image #} {%- 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 -%} {%- set light_meta = get_image_metadata(path=relative_light_path, allow_missing=true) -%} {%- if not light_meta -%} {%- set light_image_url = get_url(path=light_src) -%} {%- else -%} {%- set light_image_url = get_url(path=relative_light_path) -%} {%- endif -%} {%- endif -%} {# Handling for dark mode image #} {%- 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 -%} {%- set dark_meta = get_image_metadata(path=relative_dark_path, allow_missing=true) -%} {%- if not dark_meta -%} {%- set dark_image_url = get_url(path=dark_src) -%} {%- else -%} {%- set dark_image_url = get_url(path=relative_dark_path) -%} {%- endif -%} {%- endif -%} {%- if full_width -%}