{% from 'components/timestamp.html' import timestamp %} {% from 'components/buttons.html' import button %} {% from 'components/links.html' import fancy_link %} {% macro post_card(post) %} {% set src_ns = namespace(found=false) %} {% set src_ns.src = post.file.path if post.file.path and post.file.path|lower|regex_match("\.(gif|jpe?g|jpe|png|webp)$") %} {% if post.service == "fansly" or post.service == "candfans" or post.service == "boosty" or post.service == "gumroad"%} {% for file in post.attachments %} {% if not src_ns.src and file.path and file.path|lower|regex_match("\.(gif|jpe?g|jpe|png|webp)$") %} {% set src_ns.src = file.path %} {% endif %} {% endfor %} {% endif %} {% set post_link = g.freesites.kemono.post.link(post.service, post.user, post.id) %}
{% if post.title and post.title != "DM" %} {{ post.title }} {% elif post.content|length < 50 %} {{ post.content }} {% else %} {{ post.content[:50] + "..." }} {% endif %}
{% if src_ns.src %}
{% endif %}
{% endmacro %} {% macro post_fav_card(post) %} {% set src_ns = namespace(found=false) %} {% set src_ns.src = post.file.path if post.file.path and post.file.path|lower|regex_match("\.(gif|jpe?g|jpe|png|webp)$") %} {% if post.service == "fansly" or post.service == "candfans" or post.service == "boosty" or post.service == "gumroad"%} {% for file in post.attachments %} {% if not src_ns.src and file.path and file.path|lower|regex_match("\.(gif|jpe?g|jpe|png|webp)$") %} {% set src_ns.src = file.path %} {% endif %} {% endfor %} {% endif %} {% set post_link = g.freesites.kemono.post.link(post.service, post.user, post.id) %}
{% if post.title and post.title != "DM" %} {{ post.title }} {% elif post.content|length < 50 %} {{ post.content }} {% else %} {{ post.content[:50] + "..." }} {% endif %}
{% if src_ns.src %}
{% endif %}
{% endmacro %}