From ec129ac9ce0b143ca4c325108ea66c2d0e7352ff Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 17 Nov 2024 18:16:18 -0400 Subject: content: generate{Album,}ReferencedArtworksPage --- .../generateAlbumReferencedArtworksPage.js | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/content/dependencies/generateAlbumReferencedArtworksPage.js (limited to 'src/content/dependencies/generateAlbumReferencedArtworksPage.js') diff --git a/src/content/dependencies/generateAlbumReferencedArtworksPage.js b/src/content/dependencies/generateAlbumReferencedArtworksPage.js new file mode 100644 index 00000000..3f3d77b3 --- /dev/null +++ b/src/content/dependencies/generateAlbumReferencedArtworksPage.js @@ -0,0 +1,68 @@ +export default { + contentDependencies: [ + 'generateAlbumCoverArtwork', + 'generateAlbumStyleRules', + 'generateBackToAlbumLink', + 'generateReferencedArtworksPage', + 'linkAlbum', + ], + + extraDependencies: ['html', 'language'], + + relations: (relation, album) => ({ + page: + relation('generateReferencedArtworksPage', album.referencedArtworks), + + albumStyleRules: + relation('generateAlbumStyleRules', album, null), + + albumLink: + relation('linkAlbum', album), + + backToAlbumLink: + relation('generateBackToAlbumLink', album), + + cover: + relation('generateAlbumCoverArtwork', album), + }), + + data: (album) => ({ + name: + album.name, + + color: + album.color, + }), + + generate: (data, relations, {html, language}) => + relations.page.slots({ + title: + language.$('albumPage.title', { + album: + data.name, + }), + + color: data.color, + styleRules: [relations.albumStyleRules], + + cover: relations.cover, + + navLinks: [ + {auto: 'home'}, + + { + html: + relations.albumLink + .slot('attributes', {class: 'current'}), + + accent: + html.tag('a', {href: ''}, + {class: 'current'}, + + language.$('referencedArtworksPage.subtitle')), + }, + ], + + navBottomRowContent: relations.backToAlbumLink, + }), +}; -- cgit 1.3.0-6-gf8a5