From 7cb88275fd3c813114271c0a136b12c72c5a172a Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 19 Nov 2024 13:25:22 -0400 Subject: content: decompose generateCoverArtwork No visual/site changes yet. This involves introducing an unfortunate mega-hack in generateStickyHeadingContainer, which sets slots on cover artworks. Very scary. Oooooo Otherwise, all cover artwork code is much more compositional. Pass-through slots (`image`) are removed in generateCoverArtwork and a partially-formed `image` slot is accepted instead. --- src/content/dependencies/generateFlashCoverArtwork.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/content/dependencies/generateFlashCoverArtwork.js') diff --git a/src/content/dependencies/generateFlashCoverArtwork.js b/src/content/dependencies/generateFlashCoverArtwork.js index bcf2a55c..02590a09 100644 --- a/src/content/dependencies/generateFlashCoverArtwork.js +++ b/src/content/dependencies/generateFlashCoverArtwork.js @@ -4,7 +4,10 @@ export default { relations: (relation) => ({ coverArtwork: - relation('generateCoverArtwork', [], []), + relation('generateCoverArtwork'), + + image: + relation('image'), }), data: (flash) => ({ @@ -20,9 +23,13 @@ export default { generate: (data, relations, {language}) => relations.coverArtwork.slots({ - path: data.path, - color: data.color, + image: + relations.image.slots({ + data: data.path, + color: data.color, + alt: language.$('misc.alt.flashArt'), + }), + dimensions: data.dimensions, - alt: language.$('misc.alt.flashArt'), }), }; -- cgit 1.3.0-6-gf8a5