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}`}`;
|
||||
}
|
||||
+6
-5
@@ -1,15 +1,16 @@
|
||||
export const BG_THEMES = [
|
||||
{ id: 'dusk', label: 'Dusk' },
|
||||
{ id: 'paper', label: 'Paper' },
|
||||
{ id: 'navy', label: 'Navy' },
|
||||
{ id: 'midnight', label: 'Midnight' },
|
||||
{ id: 'indigo', label: 'Indigo' },
|
||||
{ id: 'storm', label: 'Storm' },
|
||||
{ id: 'slate', label: 'Slate' },
|
||||
{ id: 'ink', label: 'Ink' },
|
||||
{ id: 'pine', label: 'Pine' },
|
||||
{ id: 'wine', label: 'Wine' },
|
||||
{ id: 'cocoa', label: 'Cocoa' },
|
||||
{ id: 'paper', label: 'Paper' },
|
||||
// Disabled for now, I don't like them as much
|
||||
// { id: 'storm', label: 'Storm' },
|
||||
// { id: 'pine', label: 'Pine' },
|
||||
// { id: 'wine', label: 'Wine' },
|
||||
// { id: 'cocoa', label: 'Cocoa' },
|
||||
] as const;
|
||||
|
||||
export type BgThemeId = (typeof BG_THEMES)[number]['id'];
|
||||
|
||||
Reference in New Issue
Block a user