mirror of
https://github.com/jaronpate/folio.git
synced 2026-10-19 01:07:39 +00:00
projects page and unicord post
This commit is contained in:
@@ -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}`}`;
|
||||
}
|
||||
Reference in New Issue
Block a user