Add Saleh Kargar factory website with FA/AR i18n.

Clone of salehkargar.ir as a Next.js site with localized pages, SEO, and product gallery.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-14 13:35:07 +03:30
co-authored by Cursor
parent ab5425663f
commit eccbb5d79d
111 changed files with 4456 additions and 114 deletions
+105
View File
@@ -0,0 +1,105 @@
import { siteConfig } from "@/data/seo";
type JsonLdProps = {
data: Record<string, unknown> | Record<string, unknown>[];
};
export default function JsonLd({ data }: JsonLdProps) {
return (
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(data) }}
/>
);
}
export function organizationJsonLd() {
return {
"@context": "https://schema.org",
"@type": "Organization",
name: siteConfig.name,
alternateName: siteConfig.nameEn,
url: siteConfig.url,
logo: `${siteConfig.url}/images/header/logo1.png`,
image: `${siteConfig.url}${siteConfig.ogImage}`,
description: siteConfig.description,
slogan: siteConfig.slogan,
telephone: siteConfig.phone,
address: {
"@type": "PostalAddress",
addressLocality: siteConfig.address.locality,
streetAddress: siteConfig.address.street,
addressCountry: siteConfig.address.country,
},
};
}
export function localBusinessJsonLd() {
return {
"@context": "https://schema.org",
"@type": "LocalBusiness",
"@id": `${siteConfig.url}/#business`,
name: siteConfig.name,
alternateName: siteConfig.nameEn,
url: siteConfig.url,
image: `${siteConfig.url}${siteConfig.ogImage}`,
description: siteConfig.description,
telephone: siteConfig.phone[0],
address: {
"@type": "PostalAddress",
addressLocality: siteConfig.address.locality,
streetAddress: siteConfig.address.street,
addressCountry: siteConfig.address.country,
},
areaServed: {
"@type": "Country",
name: "Iran",
},
};
}
export function productJsonLd(product: {
title: string;
description: string;
image: string;
price: number;
slug: string;
}) {
return {
"@context": "https://schema.org",
"@type": "Product",
name: product.title,
description: product.description,
image: `${siteConfig.url}${product.image}`,
brand: {
"@type": "Brand",
name: siteConfig.shortName,
},
offers: {
"@type": "Offer",
url: `${siteConfig.url}/products/${product.slug}`,
priceCurrency: "IRR",
price: product.price,
availability: "https://schema.org/InStock",
seller: {
"@type": "Organization",
name: siteConfig.name,
},
},
};
}
export function breadcrumbJsonLd(
items: { name: string; path: string }[],
) {
return {
"@context": "https://schema.org",
"@type": "BreadcrumbList",
itemListElement: items.map((item, index) => ({
"@type": "ListItem",
position: index + 1,
name: item.name,
item: `${siteConfig.url}${item.path}`,
})),
};
}