refactor: ♻️ make ability component standalone

This allows to move things that are actually content out of the character data file into page content files
This commit is contained in:
Sebin Nyshkim 2025-06-26 15:19:01 +02:00
parent 0b9a604b92
commit 779e7f92a3
4 changed files with 52 additions and 94 deletions

View file

@ -1,16 +1,16 @@
<figure webc:for="ability of abilities" webc:root="override">
<figure webc:root="override">
<eleventy-image
webc:if="img"
webc:if="src"
class="image"
:src="`src/img/${char}/${ability.id}.png`"
:alt="`${char}'s ${ability.name}`"
:src="`src/img/${$data.firstName.toLowerCase()}/${src}`"
:alt="`${$data.firstName.toLowerCase()}'s ${name}`"
:width="[250, 500]"
sizes="(min-width: 64em) 500px, 250px"
></eleventy-image
><span class="no-image" webc:else>Here you would see an illustration… If I had one…</span>
<figcaption>
<p @text="ability.name"></p>
<p @text="ability.description"></p>
<p @text="name"></p>
<slot></slot>
</figcaption>
</figure>