projects page and unicord post

This commit is contained in:
2026-08-23 22:03:49 -05:00
parent 8322e0275b
commit 30d33077ec
18 changed files with 795 additions and 106 deletions
+20
View File
@@ -0,0 +1,20 @@
export function projectEntryHref(page: {
path: string;
href?: string | null;
}) {
return page.href || `/projects${page.path}`;
}
export function isExternalHref(href: string) {
return /^https?:\/\//i.test(href);
}
export function projectOgImage(
src: string | undefined,
siteUrl: string,
fallback: string,
) {
if (!src) return fallback;
if (/^https?:\/\//i.test(src)) return src;
return `${siteUrl}${src.startsWith('/') ? src : `/${src}`}`;
}