switch next and previous links to match chronological post order
This commit is contained in:
parent
9c35c72989
commit
2f61b4a453
@ -4,7 +4,7 @@ import { postData } from '../_posts/all.js';
|
||||
export function load({ params }) {
|
||||
const i = postData.findIndex(p => p.slug === params.slug);
|
||||
return {
|
||||
prev: i > 0 ? postData[i - 1].slug : null,
|
||||
next: i < postData.length - 1 ? postData[i + 1].slug : null,
|
||||
prev: i < postData.length - 1 ? postData[i + 1].slug : null,
|
||||
next: i > 0 ? postData[i - 1].slug : null,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user