diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-04-03 18:11:12 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-04-03 18:11:12 -0300 |
commit | 9aca91f5d0999ac513ebcdf7a5c74ecd952c7864 (patch) | |
tree | b6e14d9a889b02306246d3b1adbd626e14d5fb46 | |
parent | 73111fd73013d8de6403cafa33416a23ad17058c (diff) |
content: generateListingPage: base on generatePageSidebar
-rw-r--r-- | src/content/dependencies/generateListingPage.js | 2 | ||||
-rw-r--r-- | src/content/dependencies/generateListingSidebar.js | 34 | ||||
-rw-r--r-- | src/content/dependencies/generateListingsIndexPage.js | 2 |
3 files changed, 23 insertions, 15 deletions
diff --git a/src/content/dependencies/generateListingPage.js b/src/content/dependencies/generateListingPage.js index aa661abd..23377afb 100644 --- a/src/content/dependencies/generateListingPage.js +++ b/src/content/dependencies/generateListingPage.js @@ -276,7 +276,7 @@ export default { {auto: 'current'}, ], - ...relations.sidebar, + leftSidebar: relations.sidebar, }); }, }; diff --git a/src/content/dependencies/generateListingSidebar.js b/src/content/dependencies/generateListingSidebar.js index 1cdd236b..1e5c8bfc 100644 --- a/src/content/dependencies/generateListingSidebar.js +++ b/src/content/dependencies/generateListingSidebar.js @@ -1,21 +1,29 @@ export default { - contentDependencies: ['generateListingIndexList', 'linkListingIndex'], + contentDependencies: [ + 'generateListingIndexList', + 'generatePageSidebar', + 'linkListingIndex', + ], + extraDependencies: ['html'], - relations(relation, currentListing) { - return { - listingIndexLink: relation('linkListingIndex'), - listingIndexList: relation('generateListingIndexList', currentListing), - }; - }, + relations: (relation, currentListing) => ({ + sidebar: + relation('generatePageSidebar'), + + listingIndexLink: + relation('linkListingIndex'), + + listingIndexList: + relation('generateListingIndexList', currentListing), + }), - generate(relations, {html}) { - return { - leftSidebarClass: 'listing-map-sidebar-box', - leftSidebarContent: [ + generate: (relations, {html}) => + relations.sidebar.slots({ + attributes: {class: 'listing-map-sidebar-box'}, + content: [ html.tag('h1', relations.listingIndexLink), relations.listingIndexList.slot('mode', 'sidebar'), ], - }; - }, + }), }; diff --git a/src/content/dependencies/generateListingsIndexPage.js b/src/content/dependencies/generateListingsIndexPage.js index 1b1c8559..b57ebe15 100644 --- a/src/content/dependencies/generateListingsIndexPage.js +++ b/src/content/dependencies/generateListingsIndexPage.js @@ -83,7 +83,7 @@ export default { {auto: 'current'}, ], - ...relations.sidebar, + leftSidebar: relations.sidebar, }); }, }; |