获取 AMP 图片的条件标记 url

Conditional tag to get AMP image url

在 Blogger 中,我正在使我的网站得到支持,为此,在我的 post 中,我更改了所有 <img to <amp-img。 但在结构化数据中,我使用以下代码:

<div class='none' itemprop='image' itemscope='itemscope' itemtype='https://schema.org/ImageObject'>
      <b:if cond='data:post.firstImageUrl'>
        <amp-img expr:src='data:post.firstImageUrl' itemprop='image'/>
        <meta expr:content='data:post.firstImageUrl' itemprop='url'/>
      </b:if>
      <meta content='800' itemprop='width'/> <!--Images should be at least 696 pixels wide.-->
      <meta content='800' itemprop='height'/>
    </div>   
每当我在结构化数据测试中选中此工具时,Tool.Above 代码无法提取 <amp-img URL,因为它仅用于提取 <img URL。 我该如何解决这个问题?

在许多论坛上进行了大量搜索后,我找到了我的 Question.In Post 的解决方案,将 <amp-img 与来自 amp guideline 的 NoScript 结合使用。

<amp-img src="images/sunset.jpg"
  width="264"
  height="195">
  <noscript>
    <img src="images/sunset.jpg" width="264" height="195" />
  </noscript>
</amp-img>

这可以是您图像的两个版本,一个是放大器,另一个是非放大器。