format project

This commit is contained in:
Benjamin Palko 2026-08-11 16:25:07 -04:00
parent 7651afaa0b
commit a6d4064af8
83 changed files with 942 additions and 536 deletions

View file

@ -1,9 +1,11 @@
@import "tailwindcss";
@import 'tailwindcss';
@plugin "daisyui" {
themes: nord --default, forest --prefersdark;
themes:
nord --default,
forest --prefersdark;
}
:root {
@apply bg-[url("/background-light.jpg")] bg-cover font-[Roboto] dark:bg-[url("/background.jpg")];
@apply bg-[url("/background-light.jpg")] bg-cover font-[Roboto] dark:bg-[url("/background.jpg")];
}

16
src/app.d.ts vendored
View file

@ -2,13 +2,13 @@
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface PageState {}
// interface Platform {}
}
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface PageState {}
// interface Platform {}
}
}
export { };
export {};

View file

@ -2,11 +2,9 @@ import { logger } from '$lib/server/logger';
import type { HandleServerError } from '@sveltejs/kit';
export const handleError: HandleServerError = async ({ error, event, message, status }) => {
logger.error({ error, event, message, status });
logger.error({ error, event, message, status });
return {
message: 'An Internal Error Occurred',
};
return {
message: 'An Internal Error Occurred'
};
};

View file

@ -1,5 +1,5 @@
import { BicepsFlexed, Braces, Gamepad2, Globe } from "@lucide/svelte";
import type { Component } from "svelte";
import { BicepsFlexed, Braces, Gamepad2, Globe } from '@lucide/svelte';
import type { Component } from 'svelte';
type Item = {
icon: Component;
@ -7,12 +7,9 @@ type Item = {
description: string;
};
export const name: string = "Benjamin Palko";
export const name: string = 'Benjamin Palko';
export const titles: string[] = [
"Full Stack Developer",
"Video Game Developer",
];
export const titles: string[] = ['Full Stack Developer', 'Video Game Developer'];
export const description: string =
"Hi! I'm Ben, a Canadian Software Developer from Ottawa, Canada. I currently work as Full Stack Developer with a strong architectural mindsent. I enjoy learning new things and broadening my perspectives, I take pride in being a generalist which I believe gives me an edge. I enjoy working on side projects, have participated in Game Jams, fallen down the rabbit hole of Linux Ricing and Self Hosting (like this website!). I have an active life away from the desk, I do races, cycling, climbing and even wood-working! If you want to learn more about me check out my resume, my blog posts or my projects!";
@ -20,26 +17,26 @@ export const description: string =
export const activities: Item[] = [
{
icon: Globe,
title: "Web Development",
title: 'Web Development',
description:
"I have been doing this for a living for almost 7 years. I've worked on projects from Python, to Java EE, Spring Framework, .NET and a whole lot of the jungle of the Javascript/Typescript ecosystem.",
"I have been doing this for a living for almost 7 years. I've worked on projects from Python, to Java EE, Spring Framework, .NET and a whole lot of the jungle of the Javascript/Typescript ecosystem."
},
{
icon: Gamepad2,
title: "Game Development",
title: 'Game Development',
description:
"I've worked in both Unity and Godot, I hope to build my own engine and/or become a contributor! It's a hobby I do out of passion and inspiration.",
"I've worked in both Unity and Godot, I hope to build my own engine and/or become a contributor! It's a hobby I do out of passion and inspiration."
},
{
icon: BicepsFlexed,
title: "Athletics",
title: 'Athletics',
description:
"Self-proclaimed athlete, cyclist, runner and racer. I love the outdoors and I try to get out as much as I can. Excercise is important for keeping your mind sharp!",
'Self-proclaimed athlete, cyclist, runner and racer. I love the outdoors and I try to get out as much as I can. Excercise is important for keeping your mind sharp!'
},
{
icon: Braces,
title: "Linux Ricing",
title: 'Linux Ricing',
description:
"Not just a hobby, it's a lifestyle. A Pandora's box of taking back control of your tech life, and be warned, it doesn't end with just your desktop.",
},
"Not just a hobby, it's a lifestyle. A Pandora's box of taking back control of your tech life, and be warned, it doesn't end with just your desktop."
}
];

View file

@ -1,35 +1,35 @@
export type Categories = 'development' | 'work' | 'life';
export type Post = {
title: string
slug: string
description: string
image: {
url: string;
alt: string;
}
date: string
categories: Categories[]
published: boolean
}
title: string;
slug: string;
description: string;
image: {
url: string;
alt: string;
};
date: string;
categories: Categories[];
published: boolean;
};
export async function getPosts() {
const posts: Post[] = []
const posts: Post[] = [];
const paths = import.meta.glob('/src/lib/posts/*.md', { eager: true })
const paths = import.meta.glob('/src/lib/posts/*.md', { eager: true });
for (const path in paths) {
const file = paths[path]
const slug = path.split('/').at(-1)?.replace('.md', '')
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
if (post.published) posts.push(post)
}
}
if (file && typeof file === 'object' && 'metadata' in file && slug) {
const metadata = file.metadata as Omit<Post, 'slug'>;
const post = { ...metadata, slug } satisfies Post;
if (post.published) posts.push(post);
}
}
return posts.sort((first, second) =>
new Date(second.date).getTime() - new Date(first.date).getTime()
)
return posts.sort(
(first, second) => new Date(second.date).getTime() - new Date(first.date).getTime()
);
}

View file

@ -4,14 +4,14 @@ import type { PageServerLoad } from './$types';
import { getPosts } from '$lib/posts';
export const load: PageServerLoad = async () => {
try {
const posts = await getPosts();
try {
const posts = await getPosts();
return {
posts
};
} catch (err) {
logger.error('Uh-oh!', err);
error(500);
}
return {
posts
};
} catch (err) {
logger.error('Uh-oh!', err);
error(500);
}
};

View file

@ -2,15 +2,14 @@ import { error } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load: PageLoad = async ({ params }) => {
try {
const post = await import(`../../../lib/posts/${params.slug}.md`);
try {
const post = await import(`../../../lib/posts/${params.slug}.md`)
return {
content: post.default,
meta: post.metadata
}
} catch (e) {
error(404, `Could not find ${params.slug}`)
}
return {
content: post.default,
meta: post.metadata
};
} catch (e) {
error(404, `Could not find ${params.slug}`);
}
};