mirror of
https://github.com/kevinveenbirkenbach/homepage.veen.world.git
synced 2025-07-17 15:04:23 +02:00
Added backup logik for missing images
This commit is contained in:
parent
6572a39d48
commit
246ef1b059
@ -2,10 +2,15 @@
|
||||
<div class="card h-100 d-flex flex-column">
|
||||
<div class="card-body d-flex flex-column">
|
||||
<div class="card-img-top">
|
||||
{% if card.icon.class %}
|
||||
{# 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>
|
||||
{% endif %}
|
||||
{% elif card.icon.class %}
|
||||
<i class="{{ card.icon.class }}"></i>
|
||||
{% else %}
|
||||
<img src="{{ card.icon.cache }}" alt="{{ card.title }}" style="width: 100px; height: auto;">
|
||||
{% endif %}
|
||||
</div>
|
||||
<hr />
|
||||
|
Loading…
x
Reference in New Issue
Block a user