From c31d38c4778e51fb90958c40af93519661538889 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 19 Nov 2024 15:56:40 -0400 Subject: content, css: cover artwork reference details, non-unique art line --- .../dependencies/generateAlbumCoverArtwork.js | 41 ++++++++++++++++++---- 1 file changed, 35 insertions(+), 6 deletions(-) (limited to 'src/content/dependencies/generateAlbumCoverArtwork.js') diff --git a/src/content/dependencies/generateAlbumCoverArtwork.js b/src/content/dependencies/generateAlbumCoverArtwork.js index d52d57ce..1e11c0ac 100644 --- a/src/content/dependencies/generateAlbumCoverArtwork.js +++ b/src/content/dependencies/generateAlbumCoverArtwork.js @@ -3,7 +3,10 @@ export default { 'generateCoverArtwork', 'generateCoverArtworkArtTagDetails', 'generateCoverArtworkArtistDetails', + 'generateCoverArtworkReferenceDetails', 'image', + 'linkAlbumReferencedArtworks', + 'linkAlbumReferencingArtworks', ], extraDependencies: ['html', 'language'], @@ -20,6 +23,17 @@ export default { artistDetails: relation('generateCoverArtworkArtistDetails', album.coverArtistContribs), + + referenceDetails: + relation('generateCoverArtworkReferenceDetails', + album.referencedArtworks, + album.referencedByArtworks), + + referencedArtworksLink: + relation('linkAlbumReferencedArtworks', album), + + referencingArtworksLink: + relation('linkAlbumReferencingArtworks', album), }), data: (album) => ({ @@ -40,6 +54,11 @@ export default { validate: v => v.is('tags', 'artists'), default: 'tags', }, + + showReferenceLinks: { + type: 'boolean', + default: false, + }, }, generate: (data, relations, slots, {language}) => @@ -55,11 +74,21 @@ export default { dimensions: data.dimensions, - details: - (slots.details === 'tags' - ? relations.artTagDetails - : slots.details === 'artists' - ? relations.artistDetails - : null), + details: [ + slots.details === 'tags' && + relations.artTagDetails, + + slots.details === 'artists' && + relations.artistDetails, + + slots.showReferenceLinks && + relations.referenceDetails.slots({ + referencedLink: + relations.referencedArtworksLink, + + referencingLink: + relations.referencingArtworksLink, + }), + ], }), }; -- cgit 1.3.0-6-gf8a5