deprived-main-website/src/routes/post/+page.server.ts

21 lines
481 B
TypeScript

import { posts } from './data.js';
// Basically the same as Post but might contain less infomation - save storage
// type Summary = {
// url : string,
// title : string,
// description : string,
// creation_date : number,
// modification_date: number,
// };
export function load() {
return {
summaries: posts.map((post) => ({
url: post.url,
title: post.title,
description: post.description
}))
};
}