diff --git a/src/routes/post/+layout.svelte b/src/routes/post/+layout.svelte new file mode 100644 index 0000000..8df028d --- /dev/null +++ b/src/routes/post/+layout.svelte @@ -0,0 +1,5 @@ + + + + + diff --git a/src/routes/post/+page.server.js b/src/routes/post/+page.server.js deleted file mode 100644 index 8b13789..0000000 --- a/src/routes/post/+page.server.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/routes/post/+page.server.ts b/src/routes/post/+page.server.ts new file mode 100644 index 0000000..4b01c83 --- /dev/null +++ b/src/routes/post/+page.server.ts @@ -0,0 +1,20 @@ +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 + })) + }; +} diff --git a/src/routes/post/+page.svelte b/src/routes/post/+page.svelte index e69de29..81764a3 100644 --- a/src/routes/post/+page.svelte +++ b/src/routes/post/+page.svelte @@ -0,0 +1,10 @@ + + +

hello

+ diff --git a/src/routes/post/Post.svelte b/src/routes/post/Post.svelte new file mode 100644 index 0000000..e84b8ce --- /dev/null +++ b/src/routes/post/Post.svelte @@ -0,0 +1,10 @@ +
+
+ + + + + + +
+
diff --git a/src/routes/post/data.ts b/src/routes/post/data.ts new file mode 100644 index 0000000..b5e8e23 --- /dev/null +++ b/src/routes/post/data.ts @@ -0,0 +1,30 @@ +// TODO: document members +type Post = { + // Required + url : string, + title: string, + description : string, + creation_date : number + modification_date: number, + + // Optional + // TODO: author? + // TODO: image cover +} + +export const posts : Post[] = [ + { + url: 'folder-icons', + title: 'Amazing Icons for Folders in Unity!', + description: 'See how you can use Zhen\'s folder icons for Unity to boost your developer experience', + creation_date: 1708382491, + modification_date: 1708382491, + }, + { + url: 'lorem', + title: 'Lorem Ipsum !!', + description: 'This is a nice exploanation on lorem ipsum latin', + creation_date: 1708382491, + modification_date: 1708382491, + }, +];