When Full HTML page AMP conversion is enabled in Drupal 7, the theme logo (png) gets converted to an amp-img tag with proper dimensions. Still it does not display, probably because the theme does not have the appropriate theming for an amp-img tag there?

Before you try this out make sure the AMP PHP library is at latest version in your D7 installation.
drush composer-manager update lullabot/amp

Make sure you're at 62fe0d505 or later. You need to update because of https://github.com/Lullabot/amp-library/issues/27 Otherwise your png image will not get its dimensions.

Note that the logo displays in Drupal 8 where we have an svg logo. We don't attempt to convert an svg img tag to an svg amp-img tag because we don't know how to get its dimensions.

Comments

sidharth_k created an issue. See original summary.

sidharth_k’s picture

Issue summary: View changes
rainbowarray’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev

This is super duper fun. AMP will not size an image in display inline-block or float left containers unless they have a defined width. Unless the image has a fixed width set on it. So... setting a defined width on the container. Feels kludgy but so it goes. This is just an example. People can set their own desired width in their custom subthemes.

rainbowarray’s picture

Status: Active » Fixed

Should be fixed in both D8 and D7 now.

rainbowarray’s picture

Project: Accelerated Mobile Pages (AMP) » AMP Theme

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.