diff options
Diffstat (limited to 'src/content/dependencies/generateNewsEntryNavAccent.js')
-rw-r--r-- | src/content/dependencies/generateNewsEntryNavAccent.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/content/dependencies/generateNewsEntryNavAccent.js b/src/content/dependencies/generateNewsEntryNavAccent.js new file mode 100644 index 00000000..5d168e41 --- /dev/null +++ b/src/content/dependencies/generateNewsEntryNavAccent.js @@ -0,0 +1,40 @@ +export default { + contentDependencies: [ + 'generateInterpageDotSwitcher', + 'generateNextLink', + 'generatePreviousLink', + 'linkNewsEntry', + ], + + relations: (relation, previousEntry, nextEntry) => ({ + switcher: + relation('generateInterpageDotSwitcher'), + + previousLink: + relation('generatePreviousLink'), + + nextLink: + relation('generateNextLink'), + + previousEntryLink: + (previousEntry + ? relation('linkNewsEntry', previousEntry) + : null), + + nextEntryLink: + (nextEntry + ? relation('linkNewsEntry', nextEntry) + : null), + }), + + generate: (relations) => + relations.switcher.slots({ + links: [ + relations.previousLink + .slot('link', relations.previousEntryLink), + + relations.nextLink + .slot('link', relations.nextEntryLink), + ], + }), +}; |