summaryrefslogtreecommitdiff
path: root/src/routes
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/+layout.svelte20
-rw-r--r--src/routes/+layout.ts1
-rw-r--r--src/routes/+page.svelte24
-rw-r--r--src/routes/+page.ts1
-rw-r--r--src/routes/about/+page.svelte40
-rw-r--r--src/routes/apps/+page.svelte3
-rw-r--r--src/routes/posts/[slug]/+page.svelte36
-rw-r--r--src/routes/posts/[slug]/+page.ts26
8 files changed, 151 insertions, 0 deletions
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
new file mode 100644
index 0000000..ac15a2e
--- /dev/null
+++ b/src/routes/+layout.svelte
@@ -0,0 +1,20 @@
+<script lang="ts">
+ import Header from "$lib/components/Header.svelte";
+ import Footer from "$lib/components/Footer.svelte";
+ import favicon from "$lib/assets/favicon.svg";
+ import "$lib/styles/global.css";
+
+ let { children } = $props();
+</script>
+
+<svelte:head>
+ <link rel="icon" href={favicon} />
+</svelte:head>
+
+<Header title="Berke Güzel" description="Super. Bad. Code." />
+
+<main class="container">
+ {@render children()}
+</main>
+
+<Footer />
diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts
new file mode 100644
index 0000000..189f71e
--- /dev/null
+++ b/src/routes/+layout.ts
@@ -0,0 +1 @@
+export const prerender = true;
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
new file mode 100644
index 0000000..e304a68
--- /dev/null
+++ b/src/routes/+page.svelte
@@ -0,0 +1,24 @@
+<script lang="ts">
+ import PostCard from "$lib/components/PostCard.svelte";
+ import { getPosts } from "$lib/utils/posts";
+
+ const posts = getPosts();
+</script>
+
+<svelte:head>
+ <title>wenekar sucks at programming</title>
+ <meta
+ name="description"
+ content="A personal blog built with SvelteKit and MDsveX"
+ />
+</svelte:head>
+
+<section>
+ {#if posts.length === 0}
+ <p>No posts.</p>
+ {:else}
+ {#each posts as post}
+ <PostCard {post} />
+ {/each}
+ {/if}
+</section>
diff --git a/src/routes/+page.ts b/src/routes/+page.ts
new file mode 100644
index 0000000..176ae64
--- /dev/null
+++ b/src/routes/+page.ts
@@ -0,0 +1 @@
+export const prerender = true
diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte
new file mode 100644
index 0000000..3f47736
--- /dev/null
+++ b/src/routes/about/+page.svelte
@@ -0,0 +1,40 @@
+<h1>About</h1>
+
+<p>
+ My name is Berke Güzel and I am a huge fan of
+ <a href="https://supergoodcode.com">Super. Good. Code.</a>
+</p>
+
+<p>
+ I do not do code good. I am aiming to use this page as a means of publicly
+ sharing my thoughts, and
+ <i>maybe</i> projects. And who knows, maybe one day, this will grow into something
+ bigger than I could ever imagine.
+</p>
+
+<p>
+ Currently I'm employed as a software "developer", working on projects that
+ use Django/rest_framework stack.
+</p>
+
+<h2>More about me</h2>
+
+<p>
+ At present I work for a media company, they write news, also publish videos
+ on YouTube. This blog shall not contain anything about the place I work at,
+ or the future companies that I may get hired at.
+</p>
+
+<p>
+ I try avoiding social media platforms (like Facebook, Instagram etc.) like a
+ plague. If anyone seems to act like me on those platforms, be certain that
+ it is not me, and maybe report them to the platform but I doubt they would
+ do anything anyway.
+</p>
+
+<h2>Even more!</h2>
+
+<p><i>add text later</i></p>
+
+<h3>Links!</h3>
+<p><a href="https://github.com/wenekar/">GitHub</a></p>
diff --git a/src/routes/apps/+page.svelte b/src/routes/apps/+page.svelte
new file mode 100644
index 0000000..890fc31
--- /dev/null
+++ b/src/routes/apps/+page.svelte
@@ -0,0 +1,3 @@
+<h1>Apps</h1>
+
+<p><i>Coming soon...</i></p>
diff --git a/src/routes/posts/[slug]/+page.svelte b/src/routes/posts/[slug]/+page.svelte
new file mode 100644
index 0000000..2a57168
--- /dev/null
+++ b/src/routes/posts/[slug]/+page.svelte
@@ -0,0 +1,36 @@
+<script lang="ts">
+ import type { PageData } from "./$types";
+ import Giscus from "$lib/components/Giscus.svelte";
+
+ let { data }: { data: PageData } = $props();
+
+ function formatDate(dateStr: string): string {
+ return new Date(dateStr).toLocaleDateString("en-US", {
+ year: "numeric",
+ month: "long",
+ day: "numeric",
+ });
+ }
+</script>
+
+<svelte:head>
+ <title>{data.metadata.title} | My Blog</title>
+ <meta name="description" content={data.metadata.description} />
+</svelte:head>
+
+<article>
+ <header>
+ <h1>{data.metadata.title}</h1>
+ <p>
+ <time datetime={data.metadata.date}
+ >{formatDate(data.metadata.date)}</time
+ >
+ </p>
+ </header>
+
+ <data.content />
+</article>
+
+<Giscus />
+
+<a href="/">← Back to all posts</a>
diff --git a/src/routes/posts/[slug]/+page.ts b/src/routes/posts/[slug]/+page.ts
new file mode 100644
index 0000000..d0776db
--- /dev/null
+++ b/src/routes/posts/[slug]/+page.ts
@@ -0,0 +1,26 @@
+import { getPost, getPosts } from '$lib/utils/posts';
+import { error } from '@sveltejs/kit';
+import type { PageLoad } from './$types';
+
+export const prerender = true;
+
+// Generate all post routes at build time
+export function entries() {
+ const posts = getPosts();
+ return posts.map((post) => ({ slug: post.slug }));
+}
+
+export const load: PageLoad = async ({ params }) => {
+ const slug = params.slug;
+ const post = getPost(slug);
+
+ if (!post) {
+ error(404, `Post not found: ${slug}`);
+ }
+
+ return {
+ content: post.default,
+ metadata: post.metadata,
+ slug
+ };
+};