Files
MahdiandCursor b0088c35d1 Replace the landing with the artifact design and rebuild the admin in Ant Design.
Adds consultation leads, section editors, and the one-time content reset for this release.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 20:36:06 +03:30

50 lines
1.3 KiB
TypeScript

import type { PublicPage } from "@montech/shared";
export interface BlogPostSummary {
id: string;
slug: string;
title: string;
excerpt: string;
coverUrl: string | null;
publishedAt: string | null;
updatedAt?: string;
}
export interface BlogPost extends BlogPostSummary {
content: string;
seoTitle: string | null;
seoDesc: string | null;
ogImage: string | null;
canonical: string | null;
createdAt?: string;
}
export interface GalleryItem {
id: string;
title: string;
imageUrl: string;
category: string | null;
}
export function usePageMeta(key: string) {
return useAsyncData(`page-${key}`, () => apiFetch<PublicPage>(`/api/public/pages/${key}`).catch(() => null));
}
export function formatFaDate(value?: string | null) {
return value ? new Date(value).toLocaleDateString("fa-IR", { year: "numeric", month: "long", day: "numeric" }) : "";
}
export function useBreadcrumbJsonLd(items: Array<{ name: string; path: string }>) {
const siteUrl = useRuntimeConfig().public.siteUrl.replace(/\/$/, "");
useJsonLd({
"@context": "https://schema.org",
"@type": "BreadcrumbList",
itemListElement: items.map((item, i) => ({
"@type": "ListItem",
position: i + 1,
name: item.name,
item: `${siteUrl}${item.path}`,
})),
});
}