From da077e1b357d73b6c18105c91b41c004b8e04b0e Mon Sep 17 00:00:00 2001 From: Samuel Andert Date: Wed, 12 Jul 2023 10:14:03 +0200 Subject: [PATCH] Removed blog part and updated about me --- src/app.html | 1 - src/routes/+page.svelte | 52 +++++-------------------------- src/routes/+page.ts | 7 ----- src/routes/[slug]/+page.svelte | 55 --------------------------------- src/routes/[slug]/+page.ts | 14 --------- src/routes/about/+page.svelte | 8 ----- src/routes/api/posts/+server.ts | 30 ------------------ src/routes/header.svelte | 4 +-- 8 files changed, 10 insertions(+), 161 deletions(-) delete mode 100644 src/routes/+page.ts delete mode 100644 src/routes/[slug]/+page.svelte delete mode 100644 src/routes/[slug]/+page.ts delete mode 100644 src/routes/about/+page.svelte delete mode 100644 src/routes/api/posts/+server.ts diff --git a/src/app.html b/src/app.html index c57d5d5..9cb0508 100644 --- a/src/app.html +++ b/src/app.html @@ -4,7 +4,6 @@ - {config.title} -
- -
- - +

Samuel Andert

+

+ on our journey to ignite humanities full potential towards an extraordinary thriving life + experience for every human +

+Twitter +LinkedIn +Git diff --git a/src/routes/+page.ts b/src/routes/+page.ts deleted file mode 100644 index 39b5b03..0000000 --- a/src/routes/+page.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Post } from '$lib/types' - -export async function load({ fetch }) { - const response = await fetch('api/posts') - const posts: Post[] = await response.json() - return { posts } -} diff --git a/src/routes/[slug]/+page.svelte b/src/routes/[slug]/+page.svelte deleted file mode 100644 index e6d5a43..0000000 --- a/src/routes/[slug]/+page.svelte +++ /dev/null @@ -1,55 +0,0 @@ - - - - {data.meta.title} - - - - -
-
-

{data.meta.title}

-

Published at {formatDate(data.meta.date)}

-
- -
- {#each data.meta.categories as category} - #{category} - {/each} -
- -
- -
-
- - diff --git a/src/routes/[slug]/+page.ts b/src/routes/[slug]/+page.ts deleted file mode 100644 index 8d39ab4..0000000 --- a/src/routes/[slug]/+page.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { error } from '@sveltejs/kit' - -export async function load({ params }) { - try { - const post = await import(`../../posts/${params.slug}.md`) - - return { - content: post.default, - meta: post.metadata - } - } catch (e) { - throw error(404, `Could not find ${params.slug}`) - } -} diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte deleted file mode 100644 index b39733c..0000000 --- a/src/routes/about/+page.svelte +++ /dev/null @@ -1,8 +0,0 @@ -

Samuel Andert

-

- on the journey to ignite humanities full potential towards a thriving life experience for every - human -

-Twitter -Mastodon -LinkedIn diff --git a/src/routes/api/posts/+server.ts b/src/routes/api/posts/+server.ts deleted file mode 100644 index e67dfe4..0000000 --- a/src/routes/api/posts/+server.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { json } from '@sveltejs/kit' -import type { Post } from '$lib/types' - -async function getPosts() { - let posts: Post[] = [] - - const paths = import.meta.glob('/src/posts/*.md', { eager: true }) - - for (const path in paths) { - const file = paths[path] - const slug = path.split('/').at(-1)?.replace('.md', '') - - if (file && typeof file === 'object' && 'metadata' in file && slug) { - const metadata = file.metadata as Omit - const post = { ...metadata, slug } satisfies Post - post.published && posts.push(post) - } - } - - posts = posts.sort( - (first, second) => new Date(second.date).getTime() - new Date(first.date).getTime() - ) - - return posts -} - -export async function GET() { - const posts = await getPosts() - return json(posts) -} diff --git a/src/routes/header.svelte b/src/routes/header.svelte index 47143a5..eaf8930 100644 --- a/src/routes/header.svelte +++ b/src/routes/header.svelte @@ -10,10 +10,10 @@