From a213861e467ec99b2a197c4c54f9034a4d9f1516 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 19 Mar 2023 17:57:27 -0300 Subject: data steps: generateAlbumInfoPage & relations implementation --- .../dependencies/generateAlbumStylesheet.js | 61 ---------------------- 1 file changed, 61 deletions(-) delete mode 100644 src/content/dependencies/generateAlbumStylesheet.js (limited to 'src/content/dependencies/generateAlbumStylesheet.js') diff --git a/src/content/dependencies/generateAlbumStylesheet.js b/src/content/dependencies/generateAlbumStylesheet.js deleted file mode 100644 index c9547836..00000000 --- a/src/content/dependencies/generateAlbumStylesheet.js +++ /dev/null @@ -1,61 +0,0 @@ -import {empty} from '../../util/sugar.js'; - -export default { - extraDependencies: [ - 'to', - ], - - data(album) { - const data = {}; - - data.hasWallpaper = !empty(album.wallpaperArtistContribs); - data.hasBanner = !empty(album.bannerArtistContribs); - - if (data.hasWallpaper) { - data.hasWallpaperStyle = !!album.wallpaperStyle; - data.wallpaperPath = ['media.albumWallpaper', album.directory, album.wallpaperFileExtension]; - data.wallpaperStyle = album.wallpaperStyle; - } - - if (data.hasBanner) { - data.hasBannerStyle = !!album.bannerStyle; - data.bannerStyle = album.bannerStyle; - } - - return data; - }, - - generate(data, {to}) { - const wallpaperPart = - (data.hasWallpaper - ? [ - `body::before {`, - ` background-image: url("${to(...data.wallpaperPath)}");`, - ...(data.hasWallpaperStyle - ? data.wallpaperStyle - .split('\n') - .map(line => ` ${line}`) - : []), - `}`, - ] - : []); - - const bannerPart = - (data.hasBannerStyle - ? [ - `#banner img {`, - ...data.bannerStyle - .split('\n') - .map(line => ` ${line}`), - `}`, - ] - : []); - - return [ - ...wallpaperPart, - ...bannerPart, - ] - .filter(Boolean) - .join('\n'); - }, -}; -- cgit 1.3.0-6-gf8a5