mirror of
https://github.com/kevinveenbirkenbach/homepage.veen.world.git
synced 2025-09-10 03:37:11 +02:00
Implemented SVG handling
This commit is contained in:
@@ -2,12 +2,19 @@
|
||||
<div class="card h-100 d-flex flex-column">
|
||||
<div class="card-body d-flex flex-column">
|
||||
<div class="card-img-top">
|
||||
{# Prioritize image, fallback to icon via onerror #}
|
||||
{% if card.icon.cache %}
|
||||
<img src="{{ card.icon.cache }}" alt="{{ card.title }}" style="width:100px; height:auto;"
|
||||
onerror="this.style.display='none'; var icon=this.nextElementSibling; if(icon) icon.style.display='inline-block';">
|
||||
{% if card.icon.class %}
|
||||
<i class="{{ card.icon.class }}" style="display:none;"></i>
|
||||
{% if card.icon.cache.endswith('.svg') %}
|
||||
<object type="image/svg+xml" data="{{ card.icon.cache }}" style="width:100px; height:auto;">
|
||||
{% if card.icon.class %}
|
||||
<i class="{{ card.icon.class }}"></i>
|
||||
{% endif %}
|
||||
</object>
|
||||
{% else %}
|
||||
<img src="{{ card.icon.cache }}" alt="{{ card.title }}" style="width:100px; height:auto;"
|
||||
onerror="this.style.display='none'; var icon=this.nextElementSibling; if(icon) icon.style.display='inline-block';">
|
||||
{% if card.icon.class %}
|
||||
<i class="{{ card.icon.class }}" style="display:none;"></i>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% elif card.icon.class %}
|
||||
<i class="{{ card.icon.class }}"></i>
|
||||
|
Reference in New Issue
Block a user