diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-06-22 16:37:36 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-06-22 16:37:36 -0300 |
commit | 53395fa815cdf6f912e78f80bef8908005186270 (patch) | |
tree | 47a5a37c0505e8c10ffba949f5d1a34e44524598 /src/content/dependencies/generateGroupSidebar.js | |
parent | a5e6bb93032ee32f2fa19689455e6cb8dd9f3da9 (diff) |
content: group info + gallery pages
These are good to go! Only thing missing is carousels on gallery pages.
Diffstat (limited to 'src/content/dependencies/generateGroupSidebar.js')
-rw-r--r-- | src/content/dependencies/generateGroupSidebar.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/content/dependencies/generateGroupSidebar.js b/src/content/dependencies/generateGroupSidebar.js new file mode 100644 index 00000000..6baf37f4 --- /dev/null +++ b/src/content/dependencies/generateGroupSidebar.js @@ -0,0 +1,35 @@ +export default { + contentDependencies: ['generateGroupSidebarCategoryDetails'], + extraDependencies: ['html', 'language', 'wikiData'], + + sprawl({groupCategoryData}) { + return {groupCategoryData}; + }, + + relations(relation, sprawl, group) { + return { + categoryDetails: + sprawl.groupCategoryData.map(category => + relation('generateGroupSidebarCategoryDetails', category, group)), + }; + }, + + slots: { + currentExtra: { + validate: v => v.is('gallery'), + }, + }, + + generate(relations, slots, {html, language}) { + return { + leftSidebarContent: [ + html.tag('h1', + language.$('groupSidebar.title')), + + relations.categoryDetails + .map(details => + details.slot('currentExtra', slots.currentExtra)), + ], + }; + }, +}; |