有条件的标签获取AMP图像url
问题描述:
在Blogger中,我正在使我的网站功放得到支持,为此,在我的文章中,我更改了所有<img to <amp-img
。 但在结构化数据我用下面的代码:有条件的标签获取AMP图像url
<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>
<amp-img
URL,因为它被用来提取仅
<img
URL。 我该如何解决这个问题?
答
在许多论坛上搜索很多后,我发现这个解决方案对我的问题。使用后<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>
这可你的形象一版本二是放大器和其他同时是非放大器。