fix meta anf first page
This commit is contained in:
		
							parent
							
								
									80f53e871d
								
							
						
					
					
						commit
						28f5babf22
					
				|  | @ -1,5 +1,5 @@ | |||
| import React from 'react'; | ||||
| import type { Metadata } from 'next'; | ||||
| import type {Metadata, ResolvingMetadata} from 'next'; | ||||
| import { draftMode } from 'next/headers' | ||||
| import { notFound } from 'next/navigation'; | ||||
| import {fetchBlogPost, fetchBlogPosts, Widget} from "../../../../lib/contentful/blogPosts"; | ||||
|  | @ -23,7 +23,7 @@ export async function generateMetadata({ params }: BlogPostPageProps, parent: Re | |||
| 
 | ||||
|     return { | ||||
|         title: blogPost.title, | ||||
|         // description: blogPost.metaDescription
 | ||||
|         description: blogPost.metaDescription | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -77,7 +77,7 @@ export async function fetchBlogPosts({ preview, category, page, sticky }: FetchB | |||
|     const contentful = contentfulClient({ preview }) | ||||
|     const query = { | ||||
|         content_type: 'blogPost', | ||||
|         select: ['fields.title', 'fields.excerpt', 'fields.author', 'fields.listImage', 'fields.author', 'fields.category', 'sys.createdAt', 'fields.slug'], | ||||
|         select: ['fields.title', 'fields.excerpt', 'fields.author', 'fields.listImage', 'fields.author', 'fields.category', 'sys.createdAt', 'fields.slug', 'fields.metaDescription'], | ||||
|         order: ['sys.createdAt'], | ||||
|     } | ||||
|     if (category){ | ||||
|  |  | |||
|  | @ -9,6 +9,7 @@ export interface BlogPostFields { | |||
|     title?: EntryFieldTypes.Symbol | ||||
|     slug: EntryFieldTypes.Symbol | ||||
|     excerpt: EntryFieldTypes.Symbol | ||||
|     metaDescription: EntryFieldTypes.Symbol | ||||
|     listImage?: EntryFieldTypes.AssetLink | ||||
|     author?: AuthorSkeleton | ||||
|     category: BlogPostCategorySkeleton | ||||
|  | @ -28,6 +29,7 @@ export interface BlogPost { | |||
|     author: Author | null | ||||
|     category: string | ||||
|     createdAt: string | ||||
|     metaDescription: string | ||||
|     body: Array<WidgetMedia | WidgetParagraph> | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue