diff options
Diffstat (limited to 'src/content/dependencies/generateNewsEntryPage.js')
-rw-r--r-- | src/content/dependencies/generateNewsEntryPage.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/content/dependencies/generateNewsEntryPage.js b/src/content/dependencies/generateNewsEntryPage.js index fbd4f609..fa4d68a8 100644 --- a/src/content/dependencies/generateNewsEntryPage.js +++ b/src/content/dependencies/generateNewsEntryPage.js @@ -1,3 +1,4 @@ +import {atOffset} from '#sugar'; import {sortChronologically} from '#wiki-data'; export default { @@ -22,14 +23,10 @@ export default { const index = entries.indexOf(newsEntry); const previousEntry = - (index > 0 - ? entries[index - 1] - : null); + atOffset(entries, index, -1); const nextEntry = - (index < entries.length - 1 - ? entries[index + 1] - : null); + atOffset(entries, index, +1); return {previousEntry, nextEntry}; }, |