initial commit

This commit is contained in:
Hunter
2026-11-01 13:23:44 -05:00
commit e03ea4f770
53 changed files with 10802 additions and 0 deletions

38
lib/types.ts Normal file
View File

@@ -0,0 +1,38 @@
/* Mirrors BlogPost / GalleryImage in portfolio/data/content.ts. Keep in sync:
* the portfolio type-checks blog-posts.json against its own copy at build. */
export type GalleryImage = string | {
src: string;
/** Used as the image's alt text and tooltip. */
description?: string;
};
export type BlogPost = {
id: number;
slug: string; // kebab-case, URL-safe
title: string;
description: string; // 1-2 sentence excerpt shown on cards
date: string; // ISO date, e.g. "2026-09-14"
category: string; // slug, e.g. "meta" — one category per post
tags: string[];
images?: GalleryImage[]; // optional; first image is the card cover
details: string; // markdown body
};
/** A post as submitted by the editor: everything but the server-assigned id. */
export type PostInput = Omit<BlogPost, "id">;
export type ImageFile = {
name: string;
/** Path as stored in BlogPost.images (no leading slash). */
src: string;
size: number;
};
export function imageSrc(image: GalleryImage): string {
return typeof image === "string" ? image : image.src;
}
export function imageDescription(image: GalleryImage): string | undefined {
return typeof image === "string" ? undefined : image.description;
}