From 99261a74b1f3298144d8c5c6d676d63ad27a1299 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 14 Jun 2024 22:10:12 -0300 Subject: content: encapsulate everything --- src/content/dependencies/generateGroupInfoPage.js | 71 ++++++++++++----------- 1 file changed, 37 insertions(+), 34 deletions(-) (limited to 'src/content/dependencies/generateGroupInfoPage.js') diff --git a/src/content/dependencies/generateGroupInfoPage.js b/src/content/dependencies/generateGroupInfoPage.js index 956d56d8..87f35656 100644 --- a/src/content/dependencies/generateGroupInfoPage.js +++ b/src/content/dependencies/generateGroupInfoPage.js @@ -53,38 +53,41 @@ export default { }), generate: (data, relations, {html, language}) => - relations.layout.slots({ - title: language.$('groupInfoPage.title', {group: data.name}), - headingMode: 'sticky', - color: data.color, - - mainContent: [ - html.tag('p', - {[html.onlyIfContent]: true}, - language.$('releaseInfo.visitOn', { - [language.onlyIfOptions]: ['links'], - links: - language.formatDisjunctionList( - relations.visitLinks - .map(link => link.slot('context', 'group'))), - })), - - html.tag('blockquote', - {[html.onlyIfContent]: true}, - relations.description.slot('mode', 'multiline')), - - relations.albumSection, - ], - - leftSidebar: - (relations.sidebar - ? relations.sidebar - .content /* TODO: Kludge. */ - : null), - - navLinkStyle: 'hierarchical', - navLinks: relations.navLinks.content, - - secondaryNav: relations.secondaryNav ?? null, - }), + language.encapsulate('groupInfoPage', pageCapsule => + relations.layout.slots({ + title: language.$(pageCapsule, 'title', {group: data.name}), + headingMode: 'sticky', + color: data.color, + + mainContent: [ + html.tag('p', + {[html.onlyIfContent]: true}, + + language.$('releaseInfo.visitOn', { + [language.onlyIfOptions]: ['links'], + + links: + language.formatDisjunctionList( + relations.visitLinks + .map(link => link.slot('context', 'group'))), + })), + + html.tag('blockquote', + {[html.onlyIfContent]: true}, + relations.description.slot('mode', 'multiline')), + + relations.albumSection, + ], + + leftSidebar: + (relations.sidebar + ? relations.sidebar + .content /* TODO: Kludge. */ + : null), + + navLinkStyle: 'hierarchical', + navLinks: relations.navLinks.content, + + secondaryNav: relations.secondaryNav ?? null, + })), }; -- cgit 1.3.0-6-gf8a5