michalvankodev-site/axum_server/templates/components/social_card.html
Michal Vanko 221d5cef23
Some checks failed
test / cargo test (push) Failing after 1m5s
twitch and tiktok hover effects
2024-09-26 14:12:55 +02:00

15 lines
745 B
HTML

{% macro social_card_start(svg, url, heading, img, class) %}
<a href="{{url}}" class="block no-underline border rounded-md bg-pink-200 m-4 p-4 max-w-[392px] {{class}}">
<header class="flex text-center justify-center items-center gap-2 mb-2">
<svg aria-hidden="true" class="h-7 w-7 fill-blue-950">
<use xlink:href="/svg/icons-sprite.svg#{{svg}}" />
</svg>
<h3 class="text-lg font-medium mb-1 text-blue-950 visited:text-blue-950">{{heading|safe}}</h3>
</header>
{% let alt_text = format!("{svg} thumbnail") %}
{{ crate::picture_generator::picture_markup_generator::generate_picture_markup(img, 360, 128, alt_text, Some("h-auto mx-auto rounded-sm"), true).unwrap_or("thumbnail not found".to_string())|safe }}
</a>
{% endmacro %}