tangled
alpha
login
or
join now
dunkirk.sh
/
zera
5
fork
atom
the home site for me: also iteration 3 or 4 of my site
5
fork
atom
overview
issues
pulls
pipelines
feat: add imgs component
dunkirk.sh
3 months ago
cff3b625
f02db066
verified
This commit was signed with the committer's
known signature
.
dunkirk.sh
SSH Key Fingerprint:
SHA256:DqcG0RXYExE26KiWo3VxJnsxswN1QNfTBvB+bdSpk80=
+27
2 changed files
expand all
collapse all
unified
split
sass
css
mods.css
templates
shortcodes
imgs.html
+15
sass/css/mods.css
···
335
335
align-items: center;
336
336
}
337
337
338
338
+
.img-group {
339
339
+
display: flex;
340
340
+
flex-direction: row;
341
341
+
gap: 0.5rem;
342
342
+
max-width: 100%;
343
343
+
}
344
344
+
345
345
+
.img-group img {
346
346
+
flex: 1;
347
347
+
min-width: 0;
348
348
+
max-width: 100%;
349
349
+
height: auto;
350
350
+
object-fit: contain;
351
351
+
}
352
352
+
338
353
:root {
339
354
--nightshade-violet: oklch(0.27 0.0242 287.67);
340
355
--purple-night: oklch(27.58% 0.0203 289.13);
+12
templates/shortcodes/imgs.html
···
1
1
+
<figure {% if class %}class="{{class}}" {% else %}class="center" {% endif %}>
2
2
+
<div class="img-group">
3
3
+
{% set images = id | split(pat=",") %}
4
4
+
{% set alts = alt | default(value="") | split(pat=",") %}
5
5
+
{% for image in images %}
6
6
+
<img src="{{image | trim}}" {% if alts[loop.index0] %}alt="{{alts[loop.index0] | trim}}" {% endif %} />
7
7
+
{% endfor %}
8
8
+
</div>
9
9
+
{% if caption %}
10
10
+
<figcaption>{{caption | markdown | safe}}</figcaption>
11
11
+
{% endif %}
12
12
+
</figure>