From 87e044d84c8d5b6d780d60834f47a07c3aac3d12 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 15 May 2024 15:47:57 -0300 Subject: content: remove generateAdditionalFilesShortcut --- .../generateAdditionalFilesShortcut.js | 27 ---------------------- src/content/dependencies/generateAlbumInfoPage.js | 13 +++++------ src/content/dependencies/generateTrackInfoPage.js | 16 ++++--------- src/strings-default.yaml | 4 ++-- 4 files changed, 13 insertions(+), 47 deletions(-) delete mode 100644 src/content/dependencies/generateAdditionalFilesShortcut.js (limited to 'src') diff --git a/src/content/dependencies/generateAdditionalFilesShortcut.js b/src/content/dependencies/generateAdditionalFilesShortcut.js deleted file mode 100644 index 9e119bce..00000000 --- a/src/content/dependencies/generateAdditionalFilesShortcut.js +++ /dev/null @@ -1,27 +0,0 @@ -import {empty} from '#sugar'; - -export default { - extraDependencies: ['html', 'language'], - - data(additionalFiles) { - return { - titles: additionalFiles.map(fileGroup => fileGroup.title), - }; - }, - - generate(data, {html, language}) { - if (empty(data.titles)) { - return html.blank(); - } - - return language.$('releaseInfo.additionalFiles.shortcut', { - anchorLink: - html.tag('a', - {href: '#additional-files'}, - language.$('releaseInfo.additionalFiles.shortcut.anchorLink')), - - titles: - language.formatUnitList(data.titles), - }); - }, -} diff --git a/src/content/dependencies/generateAlbumInfoPage.js b/src/content/dependencies/generateAlbumInfoPage.js index e0f23bd0..739a6669 100644 --- a/src/content/dependencies/generateAlbumInfoPage.js +++ b/src/content/dependencies/generateAlbumInfoPage.js @@ -5,7 +5,6 @@ import getChronologyRelations from '../util/getChronologyRelations.js'; export default { contentDependencies: [ - 'generateAdditionalFilesShortcut', 'generateAlbumAdditionalFilesList', 'generateAlbumBanner', 'generateAlbumCoverArtwork', @@ -107,11 +106,6 @@ export default { relation('linkAlbumCommentary', album); } - if (!empty(album.additionalFiles)) { - extra.additionalFilesShortcut = - relation('generateAdditionalFilesShortcut', album.additionalFiles); - } - // Section: Track list relations.trackList = @@ -180,7 +174,12 @@ export default { {[html.joinChildren]: html.tag('br')}, [ - sec.extra.additionalFilesShortcut, + sec.additionalFiles && + language.$('releaseInfo.additionalFiles.shortcut', { + link: html.tag('a', + {href: '#additional-files'}, + language.$('releaseInfo.additionalFiles.shortcut.link')), + }), sec.extra.galleryLink && sec.extra.commentaryLink && language.$('releaseInfo.viewGalleryOrCommentary', { diff --git a/src/content/dependencies/generateTrackInfoPage.js b/src/content/dependencies/generateTrackInfoPage.js index a3ff07bd..f5324519 100644 --- a/src/content/dependencies/generateTrackInfoPage.js +++ b/src/content/dependencies/generateTrackInfoPage.js @@ -7,7 +7,6 @@ import getChronologyRelations from '../util/getChronologyRelations.js'; export default { contentDependencies: [ 'generateAbsoluteDatetimestamp', - 'generateAdditionalFilesShortcut', 'generateAlbumAdditionalFilesList', 'generateAlbumNavAccent', 'generateAlbumSecondaryNav', @@ -138,15 +137,6 @@ export default { relations.releaseInfo = relation('generateTrackReleaseInfo', track); - // Section: Extra links - - const extra = sections.extra = {}; - - if (!empty(track.additionalFiles)) { - extra.additionalFilesShortcut = - relation('generateAdditionalFilesShortcut', track.additionalFiles); - } - // Section: Other releases if (!empty(track.otherReleases)) { @@ -375,7 +365,11 @@ export default { }), sec.additionalFiles && - sec.extra.additionalFilesShortcut, + language.$('releaseInfo.additionalFiles.shortcut', { + link: html.tag('a', + {href: '#midi-project-files'}, + language.$('releaseInfo.additionalFiles.shortcut.link')), + }), sec.artistCommentary && language.$('releaseInfo.readCommentary', { diff --git a/src/strings-default.yaml b/src/strings-default.yaml index ecf29e4d..301fd5f2 100644 --- a/src/strings-default.yaml +++ b/src/strings-default.yaml @@ -334,8 +334,8 @@ releaseInfo: withSize: "{FILE} ({SIZE})" shortcut: - _: "View {ANCHOR_LINK}: {TITLES}" - anchorLink: "additional files" + _: "View {LINK}." + link: "additional files" sheetMusicFiles: heading: "Print or download sheet music files:" -- cgit 1.3.0-6-gf8a5