Render CMS meta tags and trust badges from business-info.

Injects dashboard-managed meta tags in the head and eNamad/Samandehi HTML in the footer, and enables Next standalone output for deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-10-03 18:11:28 +03:30
co-authored by Cursor
parent 804eb8702f
commit f60c98184b
4 changed files with 31 additions and 0 deletions
+1
View File
@@ -1,6 +1,7 @@
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// Leaner production runtime: deploy uses .next/standalone and drops node_modules.
output: "standalone",
allowedDevOrigins: ["sanihome.com", "localhost"],
};
+6
View File
@@ -29,10 +29,16 @@ const syne = Syne({
export async function generateMetadata(): Promise<Metadata> {
const businessInfo = await getBusinessInfo();
const other: Record<string, string> = {};
for (const tag of businessInfo?.metaTags ?? []) {
if (tag.name && tag.content) other[tag.name] = tag.content;
}
return {
title: "صنیع هوم | فروشگاه لوازم خانگی",
description: "فروشگاه آنلاین لوازم خانگی — یخچال، لباسشویی، تلویزیون و بیشتر",
icons: businessInfo?.faviconUrl ? [{ url: businessInfo.faviconUrl }] : undefined,
...(Object.keys(other).length > 0 ? { other } : {}),
};
}
+12
View File
@@ -111,6 +111,18 @@ export function Footer({
</div>
</div>
{businessInfo?.trustBadges && businessInfo.trustBadges.length > 0 ? (
<div className="mt-10 flex flex-wrap items-center justify-center gap-4 border-t border-black/10 pt-6">
{businessInfo.trustBadges.map((badge) => (
<div
key={badge.kind}
className="trust-badge [&_img]:max-h-16 [&_a]:inline-block"
dangerouslySetInnerHTML={{ __html: badge.embedHtml }}
/>
))}
</div>
) : null}
<div className="mt-10 flex flex-col items-center justify-between gap-3 border-t border-black/10 pt-6 text-xs text-black/50 md:flex-row">
<p>© ۱۴۰۵ صنیع هوم — تمامی حقوق محفوظ است.</p>
<a
+12
View File
@@ -44,6 +44,16 @@ async function apiPost<T>(
}
}
export type BusinessMetaTag = {
name: string;
content: string;
};
export type BusinessTrustBadge = {
kind: "enamad" | "samandehi";
embedHtml: string;
};
export type BusinessInfo = {
id: string;
name: string;
@@ -64,6 +74,8 @@ export type BusinessInfo = {
aparat?: string;
};
addresses: string[];
metaTags?: BusinessMetaTag[];
trustBadges?: BusinessTrustBadge[];
};
export async function getBusinessInfo(): Promise<BusinessInfo | null> {