From ab99ec27d5805a79058d7ffb92b9a5559d7524f8 Mon Sep 17 00:00:00 2001 From: iqbal024 Date: Tue, 11 Mar 2025 01:34:27 +0700 Subject: [PATCH 01/14] add css font weight --- public/assets/css/style.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/assets/css/style.css b/public/assets/css/style.css index 16c8505..3ae7ae3 100644 --- a/public/assets/css/style.css +++ b/public/assets/css/style.css @@ -4325,6 +4325,8 @@ a.logo:hover { } .main-nav.dark .inner-nav ul > li > a { font-size: 18px; + font-weight: 500; + line-height: 1.2em; color: #fff; opacity: 0.78; padding: 10px; From 66fdb977e943bf016bbe00a0bb127e1b3b966eee Mon Sep 17 00:00:00 2001 From: iqbal024 Date: Tue, 11 Mar 2025 11:37:17 +0700 Subject: [PATCH 02/14] update icon contact us and update begin path --- src/components/Blocks/BeforeFooter/index.tsx | 4 +- src/components/Contacts/Contact.tsx | 63 ++------------------ 2 files changed, 8 insertions(+), 59 deletions(-) diff --git a/src/components/Blocks/BeforeFooter/index.tsx b/src/components/Blocks/BeforeFooter/index.tsx index 2283be9..95a47af 100644 --- a/src/components/Blocks/BeforeFooter/index.tsx +++ b/src/components/Blocks/BeforeFooter/index.tsx @@ -47,8 +47,8 @@ export function BeforeFooterBlock({ title, description, buttonText, showLinier = )}
-

{title ?? placeholderTitle}

-

{description ?? placeholderDescription}

+

{title ?? placeholderTitle}

+ {description ?? placeholderDescription}
-
- -
- +

Location

@@ -61,20 +49,7 @@ async function ContactWithData() { {/* Contact Item */}
-
- -
+

Phone

@@ -89,20 +64,7 @@ async function ContactWithData() { {/* Contact Item */}
-
- -
+

Hours

{Array.isArray(contact?.hours) && @@ -118,20 +80,7 @@ async function ContactWithData() { {/* Contact Item */}
-
- -
+

Fax

From e9c800ab95165084e9cd1da84ea3c8060b147b52 Mon Sep 17 00:00:00 2001 From: RizqiSyahrendra Date: Tue, 11 Mar 2025 16:48:30 +0700 Subject: [PATCH 03/14] fix: category pages integration --- src/app/(main)/category/[...path]/page.tsx | 97 ++++++++++++++++++++-- src/components/Blogs/Blogs.tsx | 28 +++++-- src/components/Pagination.tsx | 9 +- src/services/payload/blog.ts | 24 +++++- src/utils/metadata.ts | 1 - 5 files changed, 139 insertions(+), 20 deletions(-) diff --git a/src/app/(main)/category/[...path]/page.tsx b/src/app/(main)/category/[...path]/page.tsx index 5a6b0c5..c1dd242 100644 --- a/src/app/(main)/category/[...path]/page.tsx +++ b/src/app/(main)/category/[...path]/page.tsx @@ -2,14 +2,24 @@ import { BeforeFooterBlock } from "@/components/Blocks/BeforeFooter"; import { BlogCardItemSkeleton } from "@/components/Blogs/BlogCardItem"; import Blogs from "@/components/Blogs/Blogs"; import HeroOther from "@/components/HeroOther"; +import { fetchBlogCategoryBySlug } from "@/services/payload/blog"; import { getDefaultMetadata } from "@/utils/metadata"; import { sanitizePageNumber } from "@/utils/sanitize"; import { Metadata } from "next"; -// import { headers } from "next/headers"; +import { headers } from "next/headers"; +import { notFound } from "next/navigation"; import { Suspense } from "react"; -export async function generateMetadata(): Promise { +export async function generateMetadata({ params }: { params: Promise<{ path: string[0] }> }): Promise { + const path = (await params)?.path; + const paramsCategory = path?.[0] ?? ""; const metadata = await getDefaultMetadata(); + + const category = await fetchBlogCategoryBySlug(paramsCategory); + if (!!category?.data) { + metadata.title = `${category.data.name} Archives - ${metadata.openGraph?.siteName}`; + } + return metadata; } @@ -21,19 +31,92 @@ export default async function CategoryPage({ searchParams?: Promise<{ page?: string; s?: string }>; }) { const path = (await params)?.path; - // const headersList = await headers(); - // const paramsCategory = path?.[0] ?? ""; + const paramsCategory = path?.[0] ?? ""; const paramsPage = path?.[2] ?? ""; const paramsSearch = (await searchParams)?.s; const page = sanitizePageNumber(paramsPage); + const headersList = await headers(); + const mainUrl = headersList.get("x-main-url"); + const fullUrl = headersList.get("x-full-url"); + const siteName = headersList.get("x-site-name"); + + const category = await fetchBlogCategoryBySlug(paramsCategory); + if (!category) { + notFound(); + } + + const jsonLd = { + "@context": "https://schema.org", + "@graph": [ + { + "@type": "CollectionPage", + "@id": fullUrl, + url: fullUrl, + name: `${category.data.name} - ${siteName}`, + isPartOf: { + "@id": `${mainUrl}/#website`, + }, + primaryImageOfPage: { + "@id": `${fullUrl}#primaryimage`, + }, + image: { + "@id": `${fullUrl}#primaryimage`, + }, + inLanguage: "en-US", + }, + { + "@type": "WebSite", + "@id": `${mainUrl}/#website`, + url: `${mainUrl}/`, + name: siteName, + description: "", + publisher: { + "@id": `${mainUrl}/#organization`, + }, + potentialAction: [ + { + "@type": "SearchAction", + target: { + "@type": "EntryPoint", + urlTemplate: `${mainUrl}/?s={search_term_string}`, + }, + "query-input": { + "@type": "PropertyValueSpecification", + valueRequired: true, + valueName: "search_term_string", + }, + }, + ], + inLanguage: "en-US", + }, + { + "@type": "Organization", + "@id": `${mainUrl}/#organization`, + name: siteName, + url: `${mainUrl}/`, + logo: { + "@type": "ImageObject", + inLanguage: "en-US", + "@id": `${mainUrl}/#/schema/logo/image/`, + url: `${mainUrl}/assets/images/logo-dark.webp`, + contentUrl: `${mainUrl}/assets/images/logo-dark.webp`, + caption: siteName, + }, + image: { + "@id": `${mainUrl}/#/schema/logo/image/`, + }, + }, + ], + }; return ( <> - +