Skip to content

Commit

Permalink
fix: add missing alt to lists
Browse files Browse the repository at this point in the history
  • Loading branch information
thedaviddias committed Aug 5, 2023
1 parent 87b1f4f commit 10b566d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/blog/src/components/BlogPost/BlogPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const BlogPost: React.FC<BlogPostProps> = ({ post, isCategoryPage }) => {
className="object-cover rounded-md"
src={post.frontMatter.preview.url}
fill
alt=""
alt={post.frontMatter.preview.alt || ''}
aria-hidden="true"
sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
/>
Expand Down
1 change: 1 addition & 0 deletions apps/blog/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export type FrontMatterType<Type extends 'article' | 'note' | 'project'> = {
title: string
preview: {
url: string
alt?: string
}
published?: {
on: string
Expand Down
2 changes: 2 additions & 0 deletions apps/blog/src/utils/get-article-posts/getAdjacentPosts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export function getAdjacentPosts(slug: string, locale: string, dataType: string)
slug: allPostHeaders[previousIndex].permalink,
title: allPostHeaders[previousIndex].frontMatter.title,
image: allPostHeaders[previousIndex].frontMatter?.preview?.url || '',
alt: allPostHeaders[nextIndex].frontMatter?.preview?.alt || '',
}
: null

Expand All @@ -23,6 +24,7 @@ export function getAdjacentPosts(slug: string, locale: string, dataType: string)
slug: allPostHeaders[nextIndex].permalink,
title: allPostHeaders[nextIndex].frontMatter.title,
image: allPostHeaders[nextIndex].frontMatter?.preview?.url || '',
alt: allPostHeaders[nextIndex].frontMatter?.preview?.alt || '',
}
: null

Expand Down

1 comment on commit 10b566d

@vercel
Copy link

@vercel vercel bot commented on 10b566d Aug 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.