diff --git a/src/containers/LayoutTemplateContainer/useHeaderContainer.tsx b/src/containers/LayoutTemplateContainer/useHeaderContainer.tsx index 20e20a5c6..dbd24515a 100644 --- a/src/containers/LayoutTemplateContainer/useHeaderContainer.tsx +++ b/src/containers/LayoutTemplateContainer/useHeaderContainer.tsx @@ -56,6 +56,7 @@ export const useHeaderContainer = ({ layoutTemplateData }: HeaderContainerProps) description: hit.excerpt, date: getDateToString({ date: hit.date }), readingTime: hit.readingTime, + cover: hit.cover, authors: hit.authorUsernames.map((authorUsername, index) => ({ username: authorUsername, name: hit.authorNames[index], diff --git a/src/containers/SearchPageContainer/useSearchPageContentContainer.tsx b/src/containers/SearchPageContainer/useSearchPageContentContainer.tsx index 41b943f0b..d3b7120c7 100644 --- a/src/containers/SearchPageContainer/useSearchPageContentContainer.tsx +++ b/src/containers/SearchPageContainer/useSearchPageContentContainer.tsx @@ -40,6 +40,7 @@ export const useSearchPageContentContainer = (): SearchPageContentProps => { readingTime: hit.readingTime, title: hit.title, excerpt: hit.excerpt, + cover: hit.cover, authors: hit.authorUsernames.map((authorUsername, index) => ({ username: authorUsername, name: hit.authorNames[index], diff --git a/src/helpers/indexationAlgoliaHelper.ts b/src/helpers/indexationAlgoliaHelper.ts index 4b3df34d1..1c8df1850 100644 --- a/src/helpers/indexationAlgoliaHelper.ts +++ b/src/helpers/indexationAlgoliaHelper.ts @@ -25,6 +25,7 @@ const savePosts = async (options: { categories: post.categories || [], authorUsernames: authorsByPost.map((author) => author.username), authorNames: authorsByPost.map((author) => author.name), + cover: post.cover, }; return currentPosts; diff --git a/src/types/AlgoliaData.ts b/src/types/AlgoliaData.ts index 19de47b1e..150754158 100644 --- a/src/types/AlgoliaData.ts +++ b/src/types/AlgoliaData.ts @@ -8,7 +8,7 @@ export interface AlgoliaPostData extends AlgoliaData, Pick< TransformedPostData, - 'contentType' | 'lang' | 'slug' | 'date' | 'readingTime' | 'title' | 'excerpt' | 'categories' + 'contentType' | 'lang' | 'slug' | 'date' | 'readingTime' | 'title' | 'excerpt' | 'categories' | 'cover' > { date_timestamp: number; authorUsernames: string[];