diff --git a/CONTEXT.md b/CONTEXT.md index 8b2a6ec..657d475 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -61,6 +61,13 @@ Homepage images: `GET /tenants/{domain}/website/static-images?pageKey=home`. Cat `url` → img, `linkUrl` → wrap in a link, empty/fail → placeholder. Use `slot.aspectRatio`. If a slot’s size/ratio changes in CSS, update `STATIC_IMAGE_SLOTS` in `lib/static-images.ts` in the same change. +## Tags & badges + +`GET /tenants/{domain}/website/business-info` + +- `metaTags`: `[{ name, content }]` emitted once from root `generateMetadata` as `other`. Empty → omit. +- `trustBadges`: `[{ kind: "enamad" | "samandehi", embedHtml }]` rendered in the footer with `dangerouslySetInnerHTML`. Empty → omit. Do not hardcode eNamad or Samandehi placeholders. + ## Local fallbacks - Slider: `src/assets/images/slides`, else `/placeholders/slider-*.svg` diff --git a/app/layout.tsx b/app/layout.tsx index bbd2696..12d9227 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -6,6 +6,7 @@ import { Header } from "@/components/layout/Header"; import { Footer } from "@/components/layout/Footer"; import { getNavCategories } from "@/lib/categories"; import { getLogoSrc } from "@/lib/media"; +import { getBusinessInfo, metaTagsToOther } from "@/lib/meshkee"; const vazir = Vazirmatn({ subsets: ["arabic", "latin"], @@ -14,14 +15,24 @@ const vazir = Vazirmatn({ weight: ["300", "400", "500", "600", "700", "800"], }); -export const metadata: Metadata = { - title: "داروخانه دکتر ارجمند | صفحه اصلی", - description: - "خرید آنلاین دارو، مکمل، محصولات بهداشتی و آرایشی از داروخانه دکتر ارجمند در قم، سالاریه.", -}; +export async function generateMetadata(): Promise { + const businessInfo = await getBusinessInfo(); + const other = metaTagsToOther(businessInfo?.metaTags); + + return { + title: "داروخانه دکتر ارجمند | صفحه اصلی", + description: + "خرید آنلاین دارو، مکمل، محصولات بهداشتی و آرایشی از داروخانه دکتر ارجمند در قم، سالاریه.", + ...(other ? { other } : {}), + }; +} export default async function RootLayout({ children }: { children: React.ReactNode }) { - const [logoSrc, categories] = await Promise.all([Promise.resolve(getLogoSrc()), getNavCategories()]); + const [logoSrc, categories, businessInfo] = await Promise.all([ + Promise.resolve(getLogoSrc()), + getNavCategories(), + getBusinessInfo(), + ]); return ( @@ -37,7 +48,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo
{children}
-