michalvankodev-site/templates/components/social_card.html

15 lines
749 B
HTML
Raw Permalink Normal View History

2024-09-26 14:12:55 +02:00
{% macro social_card_start(svg, url, heading, img, class) %}
2024-07-12 23:26:16 +02:00
2024-09-26 14:12:55 +02:00
<a href="{{url}}" class="block no-underline border rounded-md bg-pink-200 m-4 p-4 max-w-[392px] {{class}}">
2024-07-12 23:26:16 +02:00
<header class="flex text-center justify-center items-center gap-2 mb-2">
2024-10-03 14:59:28 +02:00
<svg role="img" aria-label="{{svg}} icon" aria-hidden="true" class="h-7 w-7 fill-blue-950">
2024-09-28 13:09:01 +02:00
<use href="#{{svg}}" />
2024-07-12 23:26:16 +02:00
</svg>
2024-09-26 14:12:55 +02:00
<h3 class="text-lg font-medium mb-1 text-blue-950 visited:text-blue-950">{{heading|safe}}</h3>
2024-07-12 23:26:16 +02:00
</header>
2024-09-25 12:55:05 +02:00
{% let alt_text = format!("{svg} thumbnail") %}
2024-07-12 23:26:16 +02:00
2024-10-07 15:42:54 +02:00
{{ crate::picture_generator::picture_markup_generator::generate_picture_markup(img, 360, 128, alt_text, Some("h-auto mx-auto rounded-sm")).unwrap_or("thumbnail not found".to_string())|safe }}
2024-09-26 14:12:55 +02:00
</a>
2024-07-12 23:26:16 +02:00
{% endmacro %}