Refactor blog components for improved tag filtering and related content display
- Added `getBlogTagFacets` API call to fetch blog tags based on city scope. - Updated `BlogsPage` to read selected tag from URL and handle tag changes with URL updates. - Modified `Title` component to display tags from the new API and reflect active tag state. - Enhanced breadcrumb navigation to link categories to their respective pages. - Adjusted related content section to display articles from the same category and fixed layout issues. - Corrected heading hierarchy across various components for better SEO compliance. - Ensured consistent styling and spacing in related content items.
This commit is contained in:
+6
-1
@@ -1,3 +1,4 @@
|
||||
import { Suspense } from "react";
|
||||
import BlogsPage from "@/components/blogs";
|
||||
import Layout from "@/components/layout/StLayout";
|
||||
import { getStateInfo } from "@/lib/getStateInfo";
|
||||
@@ -33,7 +34,11 @@ export default async function Blogs() {
|
||||
// تشخیص شهر سمت سرور انجام میشود (همان الگوی app/specialties/page.js).
|
||||
return (
|
||||
<Layout name="/blogs">
|
||||
<BlogsPage cityId={isRoot ? null : (matchedCity?.id ?? null)} />
|
||||
{/* BlogsPage تگ انتخابی را از useSearchParams میخواند؛ Next 15 برای آن
|
||||
مرز Suspense لازم دارد وگرنه prerender صفحه میشکند. */}
|
||||
<Suspense fallback={null}>
|
||||
<BlogsPage cityId={isRoot ? null : (matchedCity?.id ?? null)} />
|
||||
</Suspense>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user