-
-
-
-
-
-
-
News Headline
-
- The program not only focuses on a financial perspective, but allows you to study
- performance from many angles, such as human resources management, IT, operations
- management, risks etc.
+ {data.map((item, i) => (
+
-
-
-
-
-
-
-
-
News Headline
-
- The program not only focuses on a financial perspective, but allows you to study
- performance from many angles, such as human resources management, IT, operations
- management, risks etc.
-
-
{i18nText('readMore', locale)}
-
-
-
-
-
-
-
-
-
-
-
-
News Headline
-
- The program not only focuses on a financial perspective, but allows you to study
- performance from many angles, such as human resources management, IT, operations
- management, risks etc.
-
-
{i18nText('readMore', locale)}
-
-
-
-
-
+ ))}
+
diff --git a/src/app/[locale]/blog/[slug]/page.tsx b/src/app/[locale]/blog/[slug]/page.tsx
index 2f6aefd..f344216 100644
--- a/src/app/[locale]/blog/[slug]/page.tsx
+++ b/src/app/[locale]/blog/[slug]/page.tsx
@@ -22,7 +22,8 @@ export async function generateMetadata({ params }: BlogPostPageProps, parent: Re
}
return {
- title: blogPost.title
+ title: blogPost.title,
+ // description: blogPost.metaDescription
}
}
diff --git a/src/lib/contentful/blogPosts.ts b/src/lib/contentful/blogPosts.ts
index 415792c..92b75fd 100644
--- a/src/lib/contentful/blogPosts.ts
+++ b/src/lib/contentful/blogPosts.ts
@@ -68,8 +68,9 @@ interface FetchBlogPostsOptions {
local?: string
category?: string
page?: number
+ sticky?: boolean
}
-export async function fetchBlogPosts({ preview, category, page }: FetchBlogPostsOptions): Promise<{
+export async function fetchBlogPosts({ preview, category, page, sticky }: FetchBlogPostsOptions): Promise<{
total: number;
data: BlogPost[]
}> {
@@ -84,11 +85,18 @@ export async function fetchBlogPosts({ preview, category, page }: FetchBlogPosts
query['fields.category.sys.contentType.sys.id']='blogPostCategory'
}
+
if(page){
query['limit'] = pageSize
query['skip'] = pageSize * (page - 1)
}
+ if (sticky){ // только три для главной
+ query['fields.sticky'] = 1
+ query['limit'] = 3
+ query['skip'] = 0
+ }
+
const blogPostsResult = await contentful.getEntries
(query)
const data = blogPostsResult.items.map((blogPostEntry) => parseContentfulBlogPost(blogPostEntry) as BlogPost)