Skip to content

Commit e649755

Browse files
authored
feat: add video microdata to header block (#1123)
1 parent 447c37e commit e649755

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/blocks/Header/Header.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {useTheme} from '../../context/theme';
1111
import {Col, Grid, Row} from '../../grid';
1212
import {ClassNameProps, HeaderBlockBackground, HeaderBlockProps} from '../../models';
1313
import {block, getThemedValue} from '../../utils';
14+
import {mergeVideoMicrodata} from '../../utils/microdata';
1415

1516
import {getImageSize, getTitleSizes, titleWithImageSizes} from './utils';
1617

@@ -97,6 +98,10 @@ export const HeaderBlock = (props: React.PropsWithChildren<HeaderBlockFullProps>
9798
const backgroundThemed = background && getThemedValue(background, theme);
9899
const imageThemed = image && getThemedValue(image, theme);
99100
const videoThemed = video && getThemedValue(video, theme);
101+
const mediaWithMicrodata = mergeVideoMicrodata(videoThemed, {
102+
name: title,
103+
description,
104+
});
100105
const fullWidth = backgroundThemed?.fullWidth || backgroundThemed?.fullWidthMedia;
101106
const titleId = useUniqId();
102107

@@ -184,7 +189,7 @@ export const HeaderBlock = (props: React.PropsWithChildren<HeaderBlockFullProps>
184189
className={b('media', {[curImageSize]: true})}
185190
videoClassName={b('video')}
186191
imageClassName={b('image')}
187-
video={videoThemed}
192+
{...mediaWithMicrodata}
188193
image={imageThemed}
189194
/>
190195
)}

0 commit comments

Comments
 (0)