From b2469c03bd4bdb29c5e80752f812203a6755c159 Mon Sep 17 00:00:00 2001
From: "(quasar) nebula"
- ${[
- album.artists && strings('releaseInfo.by', {
- artists: getArtistString(album.artists, {
- showContrib: true,
- showIcons: true
- })
- }),
- album.coverArtists && strings('releaseInfo.coverArtBy', {
- artists: getArtistString(album.coverArtists, {
- showContrib: true,
- showIcons: true
- })
- }),
- album.wallpaperArtists && strings('releaseInfo.wallpaperArtBy', {
- artists: getArtistString(album.wallpaperArtists, {
- showContrib: true,
- showIcons: true
+ banner: album.bannerArtists && {
+ dimensions: album.bannerDimensions,
+ path: ['media.albumBanner', album.directory],
+ alt: strings('misc.alt.albumBanner'),
+ position: 'top'
+ },
+
+ main: {
+ content: fixWS`
+ ${generateCoverLink({
+ path: ['media.albumCover', album.directory],
+ alt: strings('misc.alt.albumCover'),
+ tags: album.artTags
+ })}
+
+ ${[
+ album.artists && strings('releaseInfo.by', {
+ artists: getArtistString(album.artists, {
+ showContrib: true,
+ showIcons: true
+ })
+ }),
+ album.coverArtists && strings('releaseInfo.coverArtBy', {
+ artists: getArtistString(album.coverArtists, {
+ showContrib: true,
+ showIcons: true
+ })
+ }),
+ album.wallpaperArtists && strings('releaseInfo.wallpaperArtBy', {
+ artists: getArtistString(album.wallpaperArtists, {
+ showContrib: true,
+ showIcons: true
+ })
+ }),
+ album.bannerArtists && strings('releaseInfo.bannerArtBy', {
+ artists: getArtistString(album.bannerArtists, {
+ showContrib: true,
+ showIcons: true
+ })
+ }),
+ strings('releaseInfo.released', {
+ date: strings.count.date(album.date)
+ }),
+ +album.coverArtDate !== +album.date && strings('releaseInfo.artReleased', {
+ date: strings.count.date(album.coverArtDate)
+ }),
+ strings('releaseInfo.duration', {
+ duration: strings.count.duration(albumDuration, {approximate: album.tracks.length > 1})
})
- }),
- album.bannerArtists && strings('releaseInfo.bannerArtBy', {
- artists: getArtistString(album.bannerArtists, {
- showContrib: true,
- showIcons: true
+ ].filter(Boolean).join(' ${
+ strings('releaseInfo.viewCommentary', {
+ link: link.albumCommentary(album, {
+ text: strings('releaseInfo.viewCommentary.link')
})
- }),
- strings('releaseInfo.released', {
- date: strings.count.date(album.date)
- }),
- +album.coverArtDate !== +album.date && strings('releaseInfo.artReleased', {
- date: strings.count.date(album.coverArtDate)
- }),
- strings('releaseInfo.duration', {
- duration: strings.count.duration(albumDuration, {approximate: album.tracks.length > 1})
- })
- ].filter(Boolean).join(' ${
- strings('releaseInfo.viewCommentary', {
- link: link.albumCommentary(album, {
- text: strings('releaseInfo.viewCommentary.link')
})
- })
- } ${
- strings('releaseInfo.listenOn', {
- links: strings.list.or(album.urls.map(url => fancifyURL(url, {album: true})))
- })
- }
- ${[
- strings('releaseInfo.addedToWiki', {
- date: strings.count.date(album.dateAdded)
+ } ${
+ strings('releaseInfo.listenOn', {
+ links: strings.list.or(album.urls.map(url => fancifyURL(url, {album: true})))
})
- ].filter(Boolean).join(' ${strings('releaseInfo.artistCommentary')}${strings('albumPage.title', {album: album.name})}
- ${strings('albumPage.title', {album: album.name})}
+
\n')}
+
\n')}
-
- ${album.trackGroups.map(({ name, color, startIndex, tracks }) => fixWS`
-
- ` : fixWS`
- <${listTag}>
- ${album.tracks.map(t => trackToListItem(t, {getArtistString, link, strings})).join('\n')}
- ${listTag}>
- `}
-
\n')}
-
- ${transformMultiline(album.commentary)}
-
- `}
- `
- },
+ }
+ ${[
+ strings('releaseInfo.addedToWiki', {
+ date: strings.count.date(album.dateAdded)
+ })
+ ].filter(Boolean).join('
\n')}
+
${strings('releaseInfo.artistCommentary')}
++ ${transformMultiline(album.commentary)} ++ `} + ` + }, - sidebarLeft: generateAlbumSidebar(album, null, { - fancifyURL, - link, - strings, - transformMultiline, - wikiData - }), + sidebarLeft: generateAlbumSidebar(album, null, { + fancifyURL, + getLinkThemeString, + link, + strings, + transformMultiline, + wikiData + }), - nav: { - links: [ - {toHome: true}, - { - html: strings('albumPage.nav.album', { - album: link.album(album, {class: 'current'}) - }) - }, - album.tracks.length > 1 && - { - divider: false, - html: generateAlbumNavLinks(album, null, {strings}) - } - ], - content: html.tag('div', generateAlbumChronologyLinks(album, null, {generateChronologyLinks})) - } - }) + nav: { + links: [ + {toHome: true}, + { + html: strings('albumPage.nav.album', { + album: link.album(album, {class: 'current'}) + }) + }, + album.tracks.length > 1 && + { + divider: false, + html: generateAlbumNavLinks(album, null, {strings}) + } + ], + content: html.tag('div', generateAlbumChronologyLinks(album, null, {generateChronologyLinks})) + } + }; + } }; return [page, data]; @@ -239,6 +255,7 @@ export function write(album, {wikiData}) { export function generateAlbumSidebar(album, currentTrack, { fancifyURL, + getLinkThemeString, link, strings, transformMultiline, diff --git a/src/page/flash.js b/src/page/flash.js index 4ffaefc6..9c59016d 100644 --- a/src/page/flash.js +++ b/src/page/flash.js @@ -4,11 +4,6 @@ import fixWS from 'fix-whitespace'; -import { - getLinkThemeString, - getThemeString -} from '../util/colors.js'; - import * as html from '../util/html.js'; import { @@ -36,6 +31,7 @@ export function write(flash, {wikiData}) { generatePreviousNextLinks, getArtistString, getFlashCover, + getThemeString, link, strings, transformInline @@ -118,6 +114,7 @@ export function writeTargetless({wikiData}) { path: ['flashIndex'], page: ({ getFlashGridHTML, + getLinkThemeString, link, strings }) => ({ diff --git a/src/page/group.js b/src/page/group.js index 5db5a8ff..698c17ec 100644 --- a/src/page/group.js +++ b/src/page/group.js @@ -8,11 +8,6 @@ import { UNRELEASED_TRACKS_DIRECTORY } from '../util/magic-constants.js'; -import { - getLinkThemeString, - getThemeString -} from '../util/colors.js'; - import * as html from '../util/html.js'; import { @@ -44,6 +39,8 @@ export function write(group, {wikiData}) { page: ({ generateInfoGalleryLinks, generatePreviousNextLinks, + getLinkThemeString, + getThemeString, fancifyURL, link, strings, @@ -92,7 +89,13 @@ export function write(group, {wikiData}) { ` }, - sidebarLeft: generateGroupSidebar(group, false, {link, strings, wikiData}), + sidebarLeft: generateGroupSidebar(group, false, { + getLinkThemeString, + link, + strings, + wikiData + }), + nav: generateGroupNav(group, false, { generateInfoGalleryLinks, generatePreviousNextLinks, @@ -110,6 +113,8 @@ export function write(group, {wikiData}) { generateInfoGalleryLinks, generatePreviousNextLinks, getAlbumGridHTML, + getLinkThemeString, + getThemeString, link, strings }) => ({ @@ -144,7 +149,13 @@ export function write(group, {wikiData}) { ` }, - sidebarLeft: generateGroupSidebar(group, true, {link, strings, wikiData}), + sidebarLeft: generateGroupSidebar(group, true, { + getLinkThemeString, + link, + strings, + wikiData + }), + nav: generateGroupNav(group, true, { generateInfoGalleryLinks, generatePreviousNextLinks, @@ -160,7 +171,12 @@ export function write(group, {wikiData}) { // Utility functions -function generateGroupSidebar(currentGroup, isGallery, {link, strings, wikiData}) { +function generateGroupSidebar(currentGroup, isGallery, { + getLinkThemeString, + link, + strings, + wikiData +}) { const { groupCategoryData, wikiInfo } = wikiData; if (!wikiInfo.features.groupUI) { diff --git a/src/page/homepage.js b/src/page/homepage.js index d1dcc680..37ec4426 100644 --- a/src/page/homepage.js +++ b/src/page/homepage.js @@ -4,10 +4,6 @@ import fixWS from 'fix-whitespace'; -import { - getLinkThemeString -} from '../util/colors.js'; - import find from '../util/find.js'; import * as html from '../util/html.js'; @@ -27,6 +23,7 @@ export function writeTargetless({wikiData}) { path: ['home'], page: ({ getAlbumGridHTML, + getLinkThemeString, link, strings, to, diff --git a/src/page/listing.js b/src/page/listing.js index b0766b28..d4021747 100644 --- a/src/page/listing.js +++ b/src/page/listing.js @@ -46,44 +46,45 @@ export function write(listing, {wikiData}) { const page = { type: 'page', path: ['listing', listing.directory], - page: ({ - link, - strings - }) => ({ - title: listing.title({strings}), - - main: { - content: fixWS` -