From 3d36a59d3689ee44d37531c5a4290bbc2bc198c0 Mon Sep 17 00:00:00 2001 From: Sveske_Juice Date: Mon, 26 Feb 2024 20:43:42 +0100 Subject: [PATCH] defualt post layout --- src/routes/+layout.server.ts | 11 +-- src/routes/+layout.svelte | 2 +- src/routes/post/+layout.svelte | 78 +++++++++++++++++++-- src/routes/posts/posts_data.ts | 9 ++- static/images/posts/folder-icons/cover.png | Bin 0 -> 24809 bytes 5 files changed, 85 insertions(+), 15 deletions(-) create mode 100644 static/images/posts/folder-icons/cover.png diff --git a/src/routes/+layout.server.ts b/src/routes/+layout.server.ts index f30d800..437a11f 100644 --- a/src/routes/+layout.server.ts +++ b/src/routes/+layout.server.ts @@ -11,15 +11,8 @@ export function load() { // Sort by newest news first posts.sort((a, b) => b.creation_date - a.creation_date); - posts.map((post) => { - let summary : Post = { - url: post.url, - title : post.title, - summary : post.summary, - creation_date : post.creation_date, - modification_date : post.modification_date - }; - summaries.push(summary); + posts.forEach((post) => { + summaries.push(post); }); return { summaries }; diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 2cb234c..6ce89cb 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -63,7 +63,7 @@