diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-05-15 15:47:57 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-05-15 18:25:25 -0300 |
commit | 87e044d84c8d5b6d780d60834f47a07c3aac3d12 (patch) | |
tree | 60fa8605cc92c6bd9e85bcdf3f4cba0f811b8b21 /src | |
parent | e5690754edf56cbbb538855448fdb1f507c077f9 (diff) |
content: remove generateAdditionalFilesShortcut
Diffstat (limited to 'src')
-rw-r--r-- | src/content/dependencies/generateAdditionalFilesShortcut.js | 27 | ||||
-rw-r--r-- | src/content/dependencies/generateAlbumInfoPage.js | 13 | ||||
-rw-r--r-- | src/content/dependencies/generateTrackInfoPage.js | 16 | ||||
-rw-r--r-- | src/strings-default.yaml | 4 |
4 files changed, 13 insertions, 47 deletions
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:" |