fix seo and first page and 404 page
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
export const metadata = {
|
||||||
|
title: "درباره ما",
|
||||||
|
description:
|
||||||
|
"فیپ یک گروه متخصص در حوزه اینتگریشن و روشهای نوین یکپارچهسازی. ماموریت، چشمانداز و ارزشهای ما.",
|
||||||
|
};
|
||||||
|
|
||||||
export default function AboutPage() {
|
export default function AboutPage() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import { revalidateTag } from "next/cache";
|
||||||
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* پاک کردن کش مقالات وردپرس.
|
||||||
|
* وقتی در وردپرس مقالهای منتشر یا ویرایش شد، این آدرس را با secret فراخوانی کنید
|
||||||
|
* تا کش دانشنامه و مقالهها بدون ریستارت سرور بهروز شود.
|
||||||
|
*
|
||||||
|
* استفاده در وردپرس:
|
||||||
|
* - با پلاگین Webhook یا کد تم: بعد از save_post درخواست به این آدرس بفرست.
|
||||||
|
* - مثال: GET یا POST /api/revalidate?secret=YOUR_REVALIDATE_SECRET
|
||||||
|
* - یا هدر: x-revalidate-secret: YOUR_REVALIDATE_SECRET
|
||||||
|
*/
|
||||||
|
export async function GET(request: NextRequest) {
|
||||||
|
return handleRevalidate(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function POST(request: NextRequest) {
|
||||||
|
return handleRevalidate(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleRevalidate(request: NextRequest) {
|
||||||
|
const secret = process.env.REVALIDATE_SECRET;
|
||||||
|
if (!secret) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{ error: "REVALIDATE_SECRET تنظیم نشده است." },
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const provided =
|
||||||
|
request.nextUrl.searchParams.get("secret") ??
|
||||||
|
request.headers.get("x-revalidate-secret");
|
||||||
|
if (provided !== secret) {
|
||||||
|
return NextResponse.json({ error: "غیرمجاز" }, { status: 401 });
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
revalidateTag("blog-posts");
|
||||||
|
return NextResponse.json({ revalidated: true, now: Date.now() });
|
||||||
|
} catch (err) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{ error: "خطا در پاک کردن کش" },
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,17 +20,33 @@ interface BlogPostPageProps {
|
|||||||
params: Promise<{ slug: string }>;
|
params: Promise<{ slug: string }>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function stripHtml(html: string): string {
|
||||||
|
return html.replace(/<[^>]*>/g, "").trim();
|
||||||
|
}
|
||||||
|
|
||||||
export async function generateMetadata({
|
export async function generateMetadata({
|
||||||
params,
|
params,
|
||||||
}: BlogPostPageProps): Promise<Metadata> {
|
}: BlogPostPageProps): Promise<Metadata> {
|
||||||
const { slug } = await params;
|
const { slug } = await params;
|
||||||
const post = await getPostBySlug(slug);
|
const post = await getPostBySlug(slug);
|
||||||
if (!post) return { title: "پست یافت نشد" };
|
if (!post) return { title: "پست یافت نشد" };
|
||||||
const title = post.title?.rendered ?? "پست";
|
const titleRaw = post.title?.rendered ?? "پست";
|
||||||
const excerpt = post.excerpt?.rendered?.replace(/<[^>]*>/g, "").trim().slice(0, 160) ?? "";
|
const title = stripHtml(titleRaw);
|
||||||
|
const excerpt = stripHtml(post.excerpt?.rendered ?? "").slice(0, 160);
|
||||||
|
const imageUrl = getFeaturedImageUrl(post, "medium_large");
|
||||||
return {
|
return {
|
||||||
title,
|
title: titleRaw,
|
||||||
description: excerpt,
|
description: excerpt,
|
||||||
|
openGraph: {
|
||||||
|
title,
|
||||||
|
description: excerpt,
|
||||||
|
...(imageUrl && { images: [{ url: imageUrl, alt: title }] }),
|
||||||
|
},
|
||||||
|
twitter: {
|
||||||
|
card: "summary_large_image",
|
||||||
|
title,
|
||||||
|
description: excerpt,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,10 @@ const PER_PAGE = 9;
|
|||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "دانشنامه",
|
title: "دانشنامه",
|
||||||
description: "مقالات و مطالب فیپ در زمینه یکپارچهسازی، اتوماسیون و بهرهوری سازمانی.",
|
description: "مقالات و مطالب فیپ در زمینه یکپارچهسازی، اتوماسیون و بهرهوری سازمانی.",
|
||||||
|
openGraph: {
|
||||||
|
title: "دانشنامه",
|
||||||
|
description: "مقالات و مطالب فیپ در زمینه یکپارچهسازی، اتوماسیون و بهرهوری سازمانی.",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
interface BlogPageProps {
|
interface BlogPageProps {
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ const faqItems = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
title: 'مشاوره سازمانی | فیپ',
|
title: 'مشاوره سازمانی',
|
||||||
description:
|
description:
|
||||||
'مشاوره تخصصی در حوزه اینتگریشن، هوشمندسازی، RAG، Performance و معماری نرمافزار. در سریعترین زمان با شما تماس میگیریم.',
|
'مشاوره تخصصی در حوزه اینتگریشن، هوشمندسازی، RAG، Performance و معماری نرمافزار. در سریعترین زمان با شما تماس میگیریم.',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import './globals.css'
|
import './globals.css'
|
||||||
|
import Link from 'next/link'
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
title: '۴۰۴ | صفحه یافت نشد',
|
title: '۴۰۴ | صفحه یافت نشد',
|
||||||
@@ -8,15 +9,32 @@ export const metadata = {
|
|||||||
export default function GlobalNotFound() {
|
export default function GlobalNotFound() {
|
||||||
return (
|
return (
|
||||||
<html lang="fa" dir="rtl" suppressHydrationWarning>
|
<html lang="fa" dir="rtl" suppressHydrationWarning>
|
||||||
<body className="antialiased min-h-svh flex flex-col items-center justify-center gap-6 px-4 bg-background text-foreground">
|
<body className="antialiased min-h-svh flex flex-col items-center justify-center px-4 py-20 bg-background text-foreground">
|
||||||
<h1 className="text-4xl font-bold">۴۰۴</h1>
|
<div className="mx-auto max-w-lg w-full text-center">
|
||||||
<p className="text-muted-foreground">این صفحه وجود ندارد.</p>
|
<div className="relative inline-block mb-6">
|
||||||
<a
|
<span
|
||||||
href="/"
|
className="text-[8rem] md:text-[10rem] font-black leading-none tracking-tighter text-transparent bg-clip-text bg-gradient-to-b from-primary/90 to-primary/50 select-none"
|
||||||
className="rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:opacity-90"
|
aria-hidden
|
||||||
>
|
>
|
||||||
بازگشت به صفحه اصلی
|
۴۰۴
|
||||||
</a>
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h1 className="text-2xl font-bold text-foreground mb-3">
|
||||||
|
صفحه پیدا نشد
|
||||||
|
</h1>
|
||||||
|
<p className="text-muted-foreground mb-10 max-w-sm mx-auto leading-relaxed">
|
||||||
|
به نظر میرسد این آدرس وجود ندارد یا منتقل شده است.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<Link
|
||||||
|
href="/"
|
||||||
|
className="inline-flex items-center justify-center gap-2 h-11 px-6 rounded-md bg-primary text-primary-foreground font-medium hover:opacity-90 transition-opacity"
|
||||||
|
>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
|
||||||
|
صفحه اصلی
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
)
|
)
|
||||||
|
|||||||
+9
-3
@@ -5,10 +5,16 @@ import { ThemeProvider } from "@/components/theme-provider";
|
|||||||
import { TopProgressBar } from "@/components/top-progress-bar";
|
import { TopProgressBar } from "@/components/top-progress-bar";
|
||||||
|
|
||||||
|
|
||||||
|
const SITE_NAME = "فیپ";
|
||||||
|
const DEFAULT_DESCRIPTION =
|
||||||
|
"فیپ یک سامانه برای ایجاد و طراحی راهکارهای مناسب برای کسب و کار شما است.";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "فیپ",
|
title: {
|
||||||
description:
|
default: `${SITE_NAME} | راهکارهای یکپارچه و هوشمند برای کسبوکار`,
|
||||||
"فیپ یک سامانه برای ایجاد و طراحی راهکارهای مناسب برای کسب و کار شما است.",
|
template: `%s | ${SITE_NAME}`,
|
||||||
|
},
|
||||||
|
description: DEFAULT_DESCRIPTION,
|
||||||
icons: {
|
icons: {
|
||||||
icon: "/assets/feep-Logo.svg",
|
icon: "/assets/feep-Logo.svg",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
|
import type { Metadata } from "next";
|
||||||
import { LoginForm } from "@/components/login-form";
|
import { LoginForm } from "@/components/login-form";
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: "ورود",
|
||||||
|
description: "ورود به حساب فیپ",
|
||||||
|
};
|
||||||
|
|
||||||
export default function LoginPage() {
|
export default function LoginPage() {
|
||||||
return (
|
return (
|
||||||
<div className="container mx-auto flex min-h-screen items-center justify-center px-4 py-16">
|
<div className="container mx-auto flex min-h-screen items-center justify-center px-4 py-16">
|
||||||
|
|||||||
+30
-12
@@ -1,21 +1,39 @@
|
|||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { Button } from '@/components/ui/button'
|
import { Button } from '@/components/ui/button'
|
||||||
|
import { Home } from 'lucide-react'
|
||||||
|
|
||||||
|
export const metadata = {
|
||||||
|
title: '۴۰۴',
|
||||||
|
description: 'صفحهای که دنبال آن هستید یافت نشد.',
|
||||||
|
}
|
||||||
|
|
||||||
export default function NotFound() {
|
export default function NotFound() {
|
||||||
return (
|
return (
|
||||||
<div className="flex min-h-[60vh] flex-col items-center justify-center gap-6 px-4 text-center">
|
<section className="min-h-[70vh] flex items-center justify-center px-4 py-20">
|
||||||
<h1 className="text-4xl font-bold text-foreground">۴۰۴</h1>
|
<div className="mx-auto max-w-lg w-full text-center">
|
||||||
<p className="text-muted-foreground max-w-md">
|
<div className="relative inline-block mb-6">
|
||||||
صفحهای که دنبال آن هستید یافت نشد.
|
<span
|
||||||
</p>
|
className="text-[8rem] md:text-[10rem] font-black leading-none tracking-tighter text-transparent bg-clip-text bg-gradient-to-b from-primary/90 to-primary/50 select-none"
|
||||||
<div className="flex flex-wrap gap-3 justify-center">
|
aria-hidden
|
||||||
<Button asChild>
|
>
|
||||||
<Link href="/">صفحه اصلی</Link>
|
۴۰۴
|
||||||
</Button>
|
</span>
|
||||||
<Button asChild variant="outline">
|
</div>
|
||||||
<Link href="/consulting">مشاوره سازمانی</Link>
|
|
||||||
|
<h1 className="text-2xl font-bold text-foreground mb-3">
|
||||||
|
صفحه پیدا نشد
|
||||||
|
</h1>
|
||||||
|
<p className="text-muted-foreground mb-10 max-w-sm mx-auto leading-relaxed">
|
||||||
|
به نظر میرسد این آدرس وجود ندارد یا منتقل شده است.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<Button asChild size="lg" className="gap-2">
|
||||||
|
<Link href="/">
|
||||||
|
<Home className="size-5" />
|
||||||
|
صفحه اصلی
|
||||||
|
</Link>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
|
import type { Metadata } from "next";
|
||||||
import ContentSection from "@/components/content-1";
|
import ContentSection from "@/components/content-1";
|
||||||
import Features from "@/components/features-12";
|
import Features from "@/components/features-12";
|
||||||
import { FeaturedPostsGrid } from "@/components/featured-posts-grid";
|
import { FeaturedPostsGrid } from "@/components/featured-posts-grid";
|
||||||
import { getPosts } from "@/lib/wp-api";
|
import { getPosts } from "@/lib/wp-api";
|
||||||
import HeroSection from "@/components/hero-section";
|
import HeroSection from "@/components/hero-section";
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
description:
|
||||||
|
"فیپ؛ راهکارهای یکپارچه و هوشمند برای اتصال سیستمها، اتوماسیون فرآیندها و بهرهوری کسبوکار.",
|
||||||
|
};
|
||||||
|
|
||||||
const FEATURED_CATEGORY_ID = 3;
|
const FEATURED_CATEGORY_ID = 3;
|
||||||
const FEATURED_POSTS_COUNT = 4;
|
const FEATURED_POSTS_COUNT = 4;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
|
import type { Metadata } from "next";
|
||||||
import Pricing from "@/components/pricing";
|
import Pricing from "@/components/pricing";
|
||||||
import PricingComparator from "@/components/pricing-comparator";
|
import PricingComparator from "@/components/pricing-comparator";
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: "قیمتگذاری",
|
||||||
|
description: "تعرفه و پلنهای خدمات فیپ. انتخاب مناسب برای کسبوکار شما.",
|
||||||
|
};
|
||||||
|
|
||||||
export default function PricingPage() {
|
export default function PricingPage() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
|
import type { Metadata } from "next";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Link as LinkIcon, BarChart3, Share2, Zap, TrendingUp, Workflow } from "lucide-react";
|
import { Link as LinkIcon, BarChart3, Share2, Zap, TrendingUp, Workflow } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: "راه حلها",
|
||||||
|
description:
|
||||||
|
"راهکارهای فیپ: یکپارچهسازی سیستمها، پنلهای مدیریتی، اتوماسیون فرآیندها و تحلیل داده.",
|
||||||
|
};
|
||||||
|
|
||||||
const solutions = [
|
const solutions = [
|
||||||
{
|
{
|
||||||
icon: LinkIcon,
|
icon: LinkIcon,
|
||||||
|
|||||||
+8
-1
@@ -1,6 +1,10 @@
|
|||||||
const WP_API_BASE = "https://wpa.feep.ir/wp-json/wp/v2";
|
const WP_API_BASE = "https://wpa.feep.ir/wp-json/wp/v2";
|
||||||
const FETCH_TIMEOUT_MS = 15_000;
|
const FETCH_TIMEOUT_MS = 15_000;
|
||||||
|
|
||||||
|
/** کش مقالات وردپرس: یک ساعت. با revalidateTag('blog-posts') از API میتوان کش را پاک کرد. */
|
||||||
|
const CACHE_REVALIDATE_SECONDS = 3600;
|
||||||
|
const CACHE_TAG_BLOG = "blog-posts";
|
||||||
|
|
||||||
export interface WpMediaSize {
|
export interface WpMediaSize {
|
||||||
source_url: string;
|
source_url: string;
|
||||||
width?: number;
|
width?: number;
|
||||||
@@ -86,7 +90,10 @@ async function fetchWithTimeout(
|
|||||||
const res = await fetch(url, {
|
const res = await fetch(url, {
|
||||||
...options,
|
...options,
|
||||||
signal: controller.signal,
|
signal: controller.signal,
|
||||||
next: { revalidate: 0 },
|
next: {
|
||||||
|
revalidate: CACHE_REVALIDATE_SECONDS,
|
||||||
|
tags: [CACHE_TAG_BLOG],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
Reference in New Issue
Block a user