From b6b1f5ecfc87d9d9e4d603703cd48a83c77b38fa Mon Sep 17 00:00:00 2001 From: Sveske_Juice Date: Fri, 23 Feb 2024 21:27:02 +0100 Subject: [PATCH] /post page styled --- src/lib/posts/NewsVerticalCard.svelte | 79 +++++++++++++++++++++++++++ src/routes/+layout.server.ts | 2 +- src/routes/post/+page.svelte | 75 ++++++++++++++++++++++--- src/routes/post/posts_data.ts | 2 +- 4 files changed, 149 insertions(+), 9 deletions(-) create mode 100644 src/lib/posts/NewsVerticalCard.svelte diff --git a/src/lib/posts/NewsVerticalCard.svelte b/src/lib/posts/NewsVerticalCard.svelte new file mode 100644 index 0000000..1b0e77e --- /dev/null +++ b/src/lib/posts/NewsVerticalCard.svelte @@ -0,0 +1,79 @@ + + +
+ +
+ {thumbnail_alt}/ +
+
+

+ {human_creation_date.getDate()} + {monthNames[human_creation_date.getMonth()]} + {human_creation_date.getFullYear()} +

+

{title}

+

{summary}

+
+
+
+ + diff --git a/src/routes/+layout.server.ts b/src/routes/+layout.server.ts index 9ebcf41..d8d824f 100644 --- a/src/routes/+layout.server.ts +++ b/src/routes/+layout.server.ts @@ -3,7 +3,7 @@ * for all posts on the website. */ -import { posts } from './post/posts_data.js'; +import { posts } from './post/posts_data'; // Basically the same as Post but might contain less infomation - save storage type Summary = { diff --git a/src/routes/post/+page.svelte b/src/routes/post/+page.svelte index 4d2b213..7bca1a4 100644 --- a/src/routes/post/+page.svelte +++ b/src/routes/post/+page.svelte @@ -1,17 +1,78 @@ - -

All posts on deprived.dev!

- + + + diff --git a/src/routes/post/posts_data.ts b/src/routes/post/posts_data.ts index 6f3ada8..ed131af 100644 --- a/src/routes/post/posts_data.ts +++ b/src/routes/post/posts_data.ts @@ -1,5 +1,5 @@ // TODO: document members -type Post = { +export type Post = { // Required url : string, title: string,