10 lines
286 B
JavaScript
10 lines
286 B
JavaScript
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,
|
|
};
|
|
} |