Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/blocks/MediaBlock/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export const MediaBlock: React.FC<Props> = (props) => {
if (media && typeof media === 'object') caption = media.caption

return (
<div
/* SEO: Using <figure> and <figcaption> semantically associates the caption text with the media, providing better context for search engine image indexers. */
<figure
className={cn(
'',
{
Expand All @@ -50,7 +51,7 @@ export const MediaBlock: React.FC<Props> = (props) => {
/>
)}
{caption && (
<div
<figcaption
className={cn(
'mt-6',
{
Expand All @@ -60,8 +61,8 @@ export const MediaBlock: React.FC<Props> = (props) => {
)}
>
<RichText data={caption} enableGutter={false} />
</div>
</figcaption>
)}
</div>
</figure>
)
}