Skip to content

Commit 1ae79c1

Browse files
committed
Ensure data-amp-layout is still available via save.js for all but Simple sites, so that images continue to display on AMP displayed pages when AMP is active
1 parent 0bef5a9 commit 1ae79c1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

projects/plugins/jetpack/extensions/blocks/tiled-gallery/gallery-image/save.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { isSimpleSite } from '@automattic/jetpack-script-data';
12
import { isBlobURL } from '@wordpress/blob';
23
import clsx from 'clsx';
34

@@ -33,6 +34,7 @@ export default function GalleryImageSave( props ) {
3334
data-url={ origUrl }
3435
data-width={ width }
3536
src={ url }
37+
{ ...( ! isSimpleSite && { 'data-amp-layout': 'responsive' } ) }
3638
/>
3739
);
3840

projects/plugins/jetpack/extensions/blocks/tiled-gallery/tiled-gallery.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ private static function interactive_markup( $image_index, $number_images ) {
189189
$image_index,
190190
$number_images
191191
);
192-
$img_element = '<img data-amp-layout="responsive" role="button" tabindex="0" aria-label="' . esc_attr( $aria_label_content ) . '"';
192+
$img_element = '<img role="button" tabindex="0" aria-label="' . esc_attr( $aria_label_content ) . '"';
193193
} else {
194-
$img_element = '<img data-amp-layout="responsive" ';
194+
$img_element = '<img ';
195195
}
196196
return $img_element;
197197
}

0 commit comments

Comments
 (0)