diff options
-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, }); }, }; |