Initial commit - modstagram-next
This commit is contained in:
68
src/config/SEO.tsx
Normal file
68
src/config/SEO.tsx
Normal file
@@ -0,0 +1,68 @@
|
||||
/*@typescript-eslint/no-explicit-any*/
|
||||
|
||||
import { IMAGE_BASE_URL } from "@/components/main/BaseUrl";
|
||||
import Head from "next/head";
|
||||
|
||||
type SEOProps = {
|
||||
type: "store" | "user" | "billboard" | "billboardSingle";
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
data: any; // داده مربوط به هر نوع صفحه
|
||||
};
|
||||
|
||||
const SEO: React.FC<SEOProps> = ({ type, data }) => {
|
||||
let title = "";
|
||||
let description = "";
|
||||
let image = "";
|
||||
|
||||
switch (type) {
|
||||
case "store":
|
||||
title = `${data.title} - ${data?.city?.name} - ${data.neighbourhood} - مدستاگرام`;
|
||||
description = `${data.description} - ${data.services}`;
|
||||
image = IMAGE_BASE_URL+ data.images[0];
|
||||
break;
|
||||
|
||||
case "user":
|
||||
title = `${data.first_name} ${data.last_name} `;
|
||||
description = `${data.bio} - ${data.user_name} - ${data.expertise}`;
|
||||
image = `${IMAGE_BASE_URL}${data.profile_image}`;
|
||||
break;
|
||||
|
||||
case "billboard":
|
||||
title = `بیلبوردها - ${data.city || "همه شهرها"}`;
|
||||
description = data.top10Titles?.join(" - ") || "بیلبوردهای برتر";
|
||||
image = data.logo || "/images/logo.png";
|
||||
break;
|
||||
|
||||
case "billboardSingle":
|
||||
title = `${data.title} - ${data.category} - ${data.neighbourhood} - مدستاگرام`;
|
||||
description = `${data.category} - ${data?.city?.name} - ${data.neighbourhood} - ${data?.address || "ادرس"}`;
|
||||
image = `${IMAGE_BASE_URL}${data.images[0]}`;
|
||||
break;
|
||||
}
|
||||
|
||||
// اطمینان از URL کامل برای تصویر
|
||||
if (image && !image.startsWith("http")) {
|
||||
image = `${process.env.NEXT_PUBLIC_BASE_URL}${image}`;
|
||||
}
|
||||
|
||||
return (
|
||||
<Head>
|
||||
<title>{title}</title>
|
||||
<meta name="description" content={description} />
|
||||
|
||||
{/* Open Graph */}
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:description" content={description} />
|
||||
<meta property="og:image" content={image} />
|
||||
<meta property="og:type" content="website" />
|
||||
|
||||
{/* Twitter Card */}
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content={title} />
|
||||
<meta name="twitter:description" content={description} />
|
||||
<meta name="twitter:image" content={image} />
|
||||
</Head>
|
||||
);
|
||||
};
|
||||
|
||||
export default SEO;
|
||||
72
src/config/seoConfig.ts
Normal file
72
src/config/seoConfig.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
import { NextSeoProps } from "next-seo";
|
||||
|
||||
const BASE_URL = "https://modstagram.com";
|
||||
|
||||
export const defaultSEOConfig: NextSeoProps = {
|
||||
title: "مدستاگرام - استخدام مدل و عکاس و آرایشگر در محل",
|
||||
description:
|
||||
"پلتفرم استخدام مدلینگ، آرایشگر در محل و عکاس حرفه ای مدل مزون، مدل عروس، مدل عکاسی، مدل آرایشی اپلیکیشنی اختصاصی استخدام و تبلیغات حوزه زیبایی",
|
||||
canonical: BASE_URL,
|
||||
openGraph: {
|
||||
type: "website",
|
||||
locale: "fa_IR",
|
||||
url: BASE_URL,
|
||||
site_name: "مدستاگرام",
|
||||
title: "مدستاگرام - استخدام مدل و عکاس و آرایشگر در محل",
|
||||
description:
|
||||
"پلتفرم استخدام مدلینگ، آرایشگر در محل و عکاس حرفه ای مدل مزون، مدل عروس، مدل عکاسی، مدل آرایشی اپلیکیشنی اختصاصی استخدام و تبلیغات حوزه زیبایی",
|
||||
images: [
|
||||
{
|
||||
url: `${BASE_URL}/images/icons/256x256.png`,
|
||||
width: 1200,
|
||||
height: 630,
|
||||
alt: "مدستاگرام",
|
||||
},
|
||||
],
|
||||
},
|
||||
twitter: {
|
||||
handle: "@modstagram",
|
||||
site: "@modstagram",
|
||||
cardType: "summary_large_image",
|
||||
},
|
||||
additionalMetaTags: [
|
||||
{
|
||||
name: "viewport",
|
||||
content: "width=device-width, initial-scale=1",
|
||||
},
|
||||
{
|
||||
name: "apple-mobile-web-app-capable",
|
||||
content: "yes",
|
||||
},
|
||||
{
|
||||
name: "apple-mobile-web-app-status-bar-style",
|
||||
content: "black",
|
||||
},
|
||||
{
|
||||
name: "msapplication-TileColor",
|
||||
content: "#0072BC",
|
||||
},
|
||||
{
|
||||
name: "samandehi",
|
||||
content: "522190795",
|
||||
},
|
||||
{
|
||||
name: "google-site-verification",
|
||||
content: "yVjB5yKPchPUtxl33GWVyMvjH6wCEInqEvaH7ZsXXMo",
|
||||
},
|
||||
],
|
||||
additionalLinkTags: [
|
||||
{
|
||||
rel: "icon",
|
||||
href: "/favicon.ico",
|
||||
},
|
||||
{
|
||||
rel: "apple-touch-icon",
|
||||
href: "/images/icons/apple-touch-icon.png",
|
||||
},
|
||||
{
|
||||
rel: "manifest",
|
||||
href: "/manifest.json",
|
||||
},
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user