Portfolio image captions and dates
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Rik Berkelder 2025-03-03 03:11:48 +01:00
parent 2102441dd2
commit beaa79b377
50 changed files with 124 additions and 76 deletions

View file

@ -73,6 +73,8 @@
new SimpleLightbox('.gallery a', {
widthRatio: 0.9,
heightRatio: 0.95,
captionSelector: '.gallery-caption',
captionType: 'text',
});
</script>
</body>

View file

@ -13,7 +13,16 @@ layout: base.njk
</div>
<div class="portfolio-detail-images gallery">
{% for image in data.images %}
<a href="{% imageUrl image %}"><img src="{{image}}" alt="" loading="lazy" /></a>
<a href="{% imageUrl image.url %}">
<img src="{{image.url}}" alt="" loading="lazy" />
{% if image.caption %}
<div class="gallery-caption">
{{image.caption}}
<small class="d-inline-block"> - {{image.date | dateLocale}}</small>
</div>
{% endif %}
</a>
{% endfor %}
</div>

View file

@ -14,7 +14,7 @@ permalink: "/portfolio/"
<a href="{{portfolioItem.data.page.url | safe}}">
<div class="flex">
{% for image in portfolioItem.data.images.slice(0,3) %}
<img src={{image}} alt="" width="400" />
<img src={{image.url}} alt="" width="400" />
{% endfor %}
</div>
</a>

BIN
content/portfolio/luxorlive/1.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/luxorlive/2.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/luxorlive/3.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/luxorlive/31.jpg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
content/portfolio/luxorlive/4.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/luxorlive/41.jpg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
content/portfolio/luxorlive/5.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/luxorlive/6.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/luxorlive/7.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/luxorlive/8.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/luxorlive/9.jpg (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/luxorlive/91.jpg (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/musis/1.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/musis/3.jpg (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/musis/4.jpg (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/musis/5.jpg (Stored with Git LFS)

Binary file not shown.

View file

@ -1,17 +1,31 @@
import * as path from 'node:path';
import * as fs from 'node:fs';
import exifr from 'exifr';
const conf = {
tags: "portfolio",
layout: "portfolio.njk",
eleventyComputed: {
images(data) {
async images(data) {
const dir = path.dirname(data.page.inputPath);
const images = fs.readdirSync(dir)
const files = fs.readdirSync(dir)
.filter(file => ['.png', '.jpg', '.jpeg', '.JPG'].includes(path.extname(file)))
.sort()
.map(image => `${data.page.url}${image}`);
.sort();
const images = await Promise.all(files.map(async (image) => {
const imagePath = path.resolve(dir + '/' + image);
const exif = await exifr.parse(imagePath, { pick: ['XPComment', 'DateTimeOriginal'] });
return {
url: data.page.url + image,
caption: exif?.XPComment ?? "",
date: exif?.DateTimeOriginal
};
}));
return images;
},

BIN
content/portfolio/sowulo/1.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/sowulo/2.jpg (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/sowulo/3.jpg (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/sowulo/4.jpg (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/sowulo/41.jpg (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/sowulo/42.jpg (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/sowulo/5.jpg (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/sowulo/6.jpg (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

BIN
content/portfolio/tivolivredenburg/001.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/tivolivredenburg/002.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/tivolivredenburg/003.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/tivolivredenburg/004.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/tivolivredenburg/005.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/tivolivredenburg/006.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/tivolivredenburg/007.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/tivolivredenburg/008.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/tivolivredenburg/009.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/tivolivredenburg/010.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/tivolivredenburg/011.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/tivolivredenburg/012.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/tivolivredenburg/013.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/willemeen/01.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/willemeen/02.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/willemeen/03.JPG (Stored with Git LFS)

Binary file not shown.

BIN
content/portfolio/willemeen/05.JPG (Stored with Git LFS)

Binary file not shown.

View file

@ -214,7 +214,7 @@ body {
}
}
figure {
figure.styled-figure {
background-color: $grey-dark;
display: inline-block;
padding: 0.5rem;
@ -348,14 +348,24 @@ body {
.gallery a {
display: inline-block;
position: relative;
overflow: hidden;
img {
transition: transform 0.3s;
&:hover {
transform: scale(1.1);
}
}
.gallery-caption {
color: $text-default;
position: absolute;
bottom: 0px;
background-color: #00000088;
width: 100%;
padding: 0.3rem 0.4rem;
}
}