Removed blog part and updated about me

This commit is contained in:
Samuel Andert 2023-07-12 10:14:03 +02:00
parent 0301373c60
commit da077e1b35
8 changed files with 10 additions and 161 deletions

View File

@ -4,7 +4,6 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<link rel="icon" href="https://fav.farm/🔥" />
<script type="module">
const theme = localStorage.getItem('color-scheme')

View File

@ -1,52 +1,16 @@
<script lang="ts">
import { formatDate } from '$lib/utils'
import * as config from '$lib/config'
export let data
</script>
<svelte:head>
<title>{config.title}</title>
</svelte:head>
<section>
<ul class="posts">
{#each data.posts as post}
<li class="post">
<a href={post.slug} class="title">{post.title}</a>
<p class="date">{formatDate(post.date)}</p>
<p class="description">{post.description}</p>
</li>
{/each}
</ul>
</section>
<style>
.posts {
display: grid;
gap: var(--size-7);
}
.post {
max-inline-size: var(--size-content-3);
}
.post:not(:last-child) {
border-bottom: 1px solid var(--border);
padding-bottom: var(--size-7);
}
.title {
font-size: var(--font-size-fluid-3);
text-transform: capitalize;
color: yellowgreen;
}
.date {
color: var(--text-2);
}
.description {
margin-top: var(--size-3);
}
</style>
<h1>Samuel Andert</h1>
<h4>
on our journey to ignite humanities full potential towards an extraordinary thriving life
experience for every human
</h4>
<a href="https://twitter.com/samuelandert">Twitter</a>
<a href="https://www.linkedin.com/in/samuel-andert-797b6211b">LinkedIn</a>
<a href="https://git.andert.me">Git</a>

View File

@ -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 }
}

View File

@ -1,55 +0,0 @@
<script lang="ts">
import { formatDate } from '$lib/utils'
export let data
</script>
<svelte:head>
<title>{data.meta.title}</title>
<meta property="og:type" content="article" />
<meta property="og:title" content={data.meta.title} />
</svelte:head>
<article>
<hgroup>
<h1>{data.meta.title}</h1>
<p>Published at {formatDate(data.meta.date)}</p>
</hgroup>
<div class="tags">
{#each data.meta.categories as category}
<span class="surface-4">&num;{category}</span>
{/each}
</div>
<div class="prose">
<svelte:component this={data.content} />
</div>
</article>
<style>
article {
max-inline-size: var(--size-content-3);
margin-inline: auto;
}
h1 {
text-transform: capitalize;
}
h1 + p {
margin-top: var(--size-2);
color: var(--text-2);
}
.tags {
display: flex;
gap: var(--size-3);
margin-top: var(--size-7);
}
.tags > * {
padding: var(--size-2) var(--size-3);
border-radius: var(--radius-round);
}
</style>

View File

@ -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}`)
}
}

View File

@ -1,8 +0,0 @@
<h1>Samuel Andert</h1>
<h4>
on the journey to ignite humanities full potential towards a thriving life experience for every
human
</h4>
<a href="https://twitter.com/samuelandert">Twitter</a>
<a href="https://mastodon.andert.me/@samuelandert">Mastodon</a>
<a href="https://www.linkedin.com/in/samuel-andert-797b6211b">LinkedIn</a>

View File

@ -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<Post, 'slug'>
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)
}

View File

@ -10,10 +10,10 @@
<ul class="links">
<li>
<a href="/about">About Me</a>
<a href="/">About Me</a>
</li>
<li>
<a href="/">Blog</a>
<a href="https://blog.andert.me">Blog</a>
</li>
</ul>