From 8f4473336fcf9ed94222797ce7e0c35226a90cbb Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 6 Apr 2023 10:57:42 -0300 Subject: build steps: jank together ultra-basic page write Super simple technically functional sketch. --- src/content/dependencies/generateAlbumInfoPage.js | 11 +++- .../dependencies/generateAlbumInfoPageContent.js | 65 ++++++++++++++++++++-- .../dependencies/generateAlbumSocialEmbed.js | 2 +- .../dependencies/generateColorStyleRules.js | 3 +- 4 files changed, 72 insertions(+), 9 deletions(-) (limited to 'src/content/dependencies') diff --git a/src/content/dependencies/generateAlbumInfoPage.js b/src/content/dependencies/generateAlbumInfoPage.js index 74d80e33..59c314a1 100644 --- a/src/content/dependencies/generateAlbumInfoPage.js +++ b/src/content/dependencies/generateAlbumInfoPage.js @@ -21,7 +21,16 @@ export default { return relations; }, - generate(relations, { + data(album) { + const data = {}; + + data.name = album.name; + data.color = album.color; + + return data; + }, + + generate(data, relations, { language, }) { const page = {}; diff --git a/src/content/dependencies/generateAlbumInfoPageContent.js b/src/content/dependencies/generateAlbumInfoPageContent.js index e959f274..a17a33f1 100644 --- a/src/content/dependencies/generateAlbumInfoPageContent.js +++ b/src/content/dependencies/generateAlbumInfoPageContent.js @@ -56,11 +56,11 @@ export default { relation('linkAlbumCommentary', album); } - if (!empty(album.urls)) { - relations.externalLinks = - album.urls.map(url => - relation('linkExternal', url, {type: 'album'})); - } + relations.externalLinks = + (empty(album.urls) + ? null + : album.urls.map(url => + relation('linkExternal', url, {type: 'album'}))); relations.trackList = relation('generateAlbumTrackList', album); @@ -237,3 +237,58 @@ export default { return content; }, }; + +/* + banner: !empty(album.bannerArtistContribs) && { + dimensions: album.bannerDimensions, + path: [ + 'media.albumBanner', + album.directory, + album.bannerFileExtension, + ], + alt: language.$('misc.alt.albumBanner'), + position: 'top', + }, + + sidebarLeft: generateAlbumSidebar(album, null, { + fancifyURL, + getLinkThemeString, + html, + link, + language, + transformMultiline, + wikiData, + }), + + nav: { + linkContainerClasses: ['nav-links-hierarchy'], + links: [ + {toHome: true}, + { + html: language.$('albumPage.nav.album', { + album: link.album(album, {class: 'current'}), + }), + }, + { + divider: false, + html: generateAlbumNavLinks(album, null, { + generateNavigationLinks, + html, + language, + link, + }), + } + ], + content: generateAlbumChronologyLinks(album, null, { + generateChronologyLinks, + html, + }), + }, + + secondaryNav: generateAlbumSecondaryNav(album, null, { + getLinkThemeString, + html, + language, + link, + }), +*/ diff --git a/src/content/dependencies/generateAlbumSocialEmbed.js b/src/content/dependencies/generateAlbumSocialEmbed.js index 8786a336..656bd997 100644 --- a/src/content/dependencies/generateAlbumSocialEmbed.js +++ b/src/content/dependencies/generateAlbumSocialEmbed.js @@ -74,7 +74,7 @@ export default { if (data.hasImage) { const imagePath = urls .from('shared.root') - .to('media.albumColor', data.coverArtDirectory, data.coverArtFileExtension); + .to('media.albumCover', data.coverArtDirectory, data.coverArtFileExtension); socialEmbed.image = '/' + imagePath; } diff --git a/src/content/dependencies/generateColorStyleRules.js b/src/content/dependencies/generateColorStyleRules.js index 02c3380e..44600935 100644 --- a/src/content/dependencies/generateColorStyleRules.js +++ b/src/content/dependencies/generateColorStyleRules.js @@ -10,7 +10,7 @@ export default { generate(data, { getColors, }) { - if (!color) return ''; + if (!data.color) return ''; const { primary, @@ -30,7 +30,6 @@ export default { `--bg-color: ${bg}`, `--bg-black-color: ${bgBlack}`, `--shadow-color: ${shadow}`, - ...additionalVariables, ]; return [ -- cgit 1.3.0-6-gf8a5