mirror of
https://github.com/Patiun/com.gregkilmer.www.git
synced 2026-11-08 04:08:24 +00:00
Phase 5: every page of the site, the resume PDF and RSS
Landing, About, Now, Resume (with a generated PDF), Work and case studies, Inquiries and the sent page, Library and the Shelf, Workshop and craft pages, Tabletop, Blog with topics and posts, RSS, the Store, product lines, the order form and the 404, all rendered from the content service's notes. Schema: experience previousRoles, skills stack core items, page stats, make tags and deck favorite. Icon names from notes map to brand icons in one place, and HTML comments are dropped when Markdown renders. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012aSbo2D1qP8cMFQCykf7kx
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
/** The resume's data, shared by the page and the PDF so they never disagree. */
|
||||
import type { Note } from "./content.ts";
|
||||
import type { SiteIndex } from "./site.ts";
|
||||
|
||||
export interface ResumeData {
|
||||
name: string;
|
||||
headline: string;
|
||||
location?: string;
|
||||
summary?: string;
|
||||
availability?: string;
|
||||
stats: { value: string; label: string; detail?: string }[];
|
||||
roles: Note<"experience">[];
|
||||
skills?: Note<"skills">["data"];
|
||||
education?: Note<"education">["data"];
|
||||
socials: { label: string; handle: string; url: string }[];
|
||||
/** The newest change to any note the resume is built from (YYYY-MM-DD). */
|
||||
updated: string;
|
||||
}
|
||||
|
||||
/** "Mar 2019", from "2019-03". */
|
||||
export const month = (ym: string | undefined) => {
|
||||
if (!ym) return "Present";
|
||||
const [y, m] = ym.split("-").map(Number);
|
||||
return new Date(Date.UTC(y!, (m ?? 1) - 1, 1)).toLocaleDateString("en-US", { timeZone: "UTC", month: "short", year: "numeric" });
|
||||
};
|
||||
|
||||
export const period = (r: Note<"experience">) => `${month(r.data.start)} – ${month(r.data.end)}`;
|
||||
|
||||
export function resumeData(s: SiteIndex): ResumeData {
|
||||
const settings = s.settings();
|
||||
const page = s.pageText("/resume");
|
||||
const roles = [...s.all("experience")].sort((a, b) => (b.data.end ?? "9999").localeCompare(a.data.end ?? "9999") || b.data.start.localeCompare(a.data.start));
|
||||
const current = roles.find((r) => !r.data.end) ?? roles[0];
|
||||
const sources: Note[] = [...roles, ...(page ? [page] : []), ...[s.one("skills"), s.one("education")].filter((n): n is Note<"skills"> | Note<"education"> => !!n)];
|
||||
const updated = sources.map((n) => n.acceptedAt?.slice(0, 10) ?? "").sort().at(-1) ?? "";
|
||||
return {
|
||||
name: settings?.name ?? "Greg Kilmer",
|
||||
headline: page?.data.lede ?? current?.data.role ?? "",
|
||||
location: settings?.location,
|
||||
summary: page?.body?.trim() || undefined,
|
||||
availability: settings?.availability,
|
||||
stats: page?.data.stats ?? [],
|
||||
roles,
|
||||
skills: s.one("skills")?.data,
|
||||
education: s.one("education")?.data,
|
||||
socials: settings?.socials ?? [],
|
||||
updated,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user