{#- A value of a document as pygeoapi's item page shows it: an image URL as the image, a URL as a link, URLs inside a text as links, objects and lists as nested lists. -#} {% macro show(value) -%} {%- if value is mapping -%} {%- elif value is string -%} {%- if value.startswith(("http://", "https://")) and value.lower().endswith((".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp")) -%} {{ value.rsplit('/', 1)[-1] }} {%- elif value.startswith(("http://", "https://")) and " " not in value -%} {{ value }} {%- else -%} {{ value | urlize }} {%- endif -%} {%- elif value is iterable -%} {%- elif value is not none -%} {{ value }} {%- endif -%} {%- endmacro %}