diff options
Diffstat (limited to 'src/content')
-rw-r--r-- | src/content/dependencies/generatePreviousNextLinks.js | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/content/dependencies/generatePreviousNextLinks.js b/src/content/dependencies/generatePreviousNextLinks.js index 6cffcef4..e3417cb8 100644 --- a/src/content/dependencies/generatePreviousNextLinks.js +++ b/src/content/dependencies/generatePreviousNextLinks.js @@ -8,25 +8,32 @@ export default { slots: { previousLink: {type: 'html'}, nextLink: {type: 'html'}, + id: {type: 'boolean', default: true}, }, generate(slots, {html, language}) { - return [ - !html.isBlank(slots.previousLink) && + const previousNext = []; + + if (!html.isBlank(slots.previousLink)) { + previousNext.push( slots.previousLink.slots({ tooltip: true, color: false, - attributes: {id: 'previous-button'}, + attributes: {id: slots.id && 'previous-button'}, content: language.$('misc.nav.previous'), - }), + })); + } - !html.isBlank(slots.nextLink) && - slots.nextLink?.slots({ + if (!html.isBlank(slots.nextLink)) { + previousNext.push( + slots.nextLink.slots({ tooltip: true, color: false, - attributes: {id: 'next-button'}, + attributes: {id: slots.id && 'next-button'}, content: language.$('misc.nav.next'), - }), - ]; + })); + } + + return previousNext; }, }; |