Skip to content

Commit

Permalink
fix: indexation cover (#1087)
Browse files Browse the repository at this point in the history
  • Loading branch information
fpasquet committed Apr 4, 2024
1 parent 4eb2ba5 commit 58b67c5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
1 change: 1 addition & 0 deletions src/helpers/indexationAlgoliaHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/types/AlgoliaData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down

0 comments on commit 58b67c5

Please sign in to comment.