{# Title tag #}
{% set title = null %}
{% for tag in event.tags %}
{% if tag[0] == 'title' %}
{% set title = tag[1] %}
{% endif %}
{% endfor %}
{% if title %}
{{ title }}
{% endif %}
{# Content warning #}
{% set contentWarning = null %}
{% for tag in event.tags %}
{% if tag[0] == 'content-warning' %}
{% set contentWarning = tag[1] %}
{% endif %}
{% endfor %}
{% if contentWarning %}
⚠️ Content Warning: {{ contentWarning }}
{% else %}
{% endif %}
{# Display images from imeta tags #}
{% for tag in event.tags %}
{% if tag[0] == 'imeta' %}
{% set imageUrl = null %}
{% set mimeType = null %}
{% set blurhash = null %}
{% set dimensions = null %}
{% set altText = null %}
{% set fallbacks = [] %}
{% set annotatedUsers = [] %}
{# Parse imeta tag parameters #}
{% for i in 1..(tag|length - 1) %}
{% set param = tag[i] %}
{% if param starts with 'url ' %}
{% set imageUrl = param[4:] %}
{% elseif param starts with 'm ' %}
{% set mimeType = param[2:] %}
{% elseif param starts with 'blurhash ' %}
{% set blurhash = param[9:] %}
{% elseif param starts with 'dim ' %}
{% set dimensions = param[4:] %}
{% elseif param starts with 'alt ' %}
{% set altText = param[4:] %}
{% elseif param starts with 'fallback ' %}
{% set fallbacks = fallbacks|merge([param[9:]]) %}
{% elseif param starts with 'annotate-user ' %}
{% set annotatedUsers = annotatedUsers|merge([param[14:]]) %}
{% endif %}
{% endfor %}
{% if imageUrl %}
{% for fallback in fallbacks %}
{% endfor %}
{# Display annotated users #}
{% if annotatedUsers|length > 0 %}
{% for userAnnotation in annotatedUsers %}
{% set parts = userAnnotation|split(':') %}
{% if parts|length == 3 %}
{% endif %}
{% endfor %}
{% endif %}
{% if altText %}
{{ altText }}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{# Description from content #}
{% if event.content %}
{% endif %}
{# Location data #}
{% set location = null %}
{% set geohash = null %}
{% for tag in event.tags %}
{% if tag[0] == 'location' %}
{% set location = tag[1] %}
{% elseif tag[0] == 'g' %}
{% set geohash = tag[1] %}
{% endif %}
{% endfor %}
{% if location or geohash %}
📍
{% if location %}{{ location }}{% endif %}
{% if geohash %}{{ geohash[:6] }}...{% endif %}
{% endif %}
{# Hashtags #}
{% set hashtags = [] %}
{% for tag in event.tags %}
{% if tag[0] == 't' %}
{% set hashtags = hashtags|merge([tag[1]]) %}
{% endif %}
{% endfor %}
{% if hashtags|length > 0 %}
{% for hashtag in hashtags %}
#{{ hashtag }}
{% endfor %}