AMP是否支持facebook,twiiter和google plus分享按钮?这里或github上没有关于这个问题的明确信息.
据我了解放大器,放大器仅适用于移动设备.如果我使用自适应设计,我的Web服务器会为每个设备提供相同的HTML文档.
但是如果我想使用AMP,Web服务器应该决定它是为桌面提供HTML还是为AMP提供HTML.
我怎么做?通过User-Agent?(我认为它很难看,而且不可扩展)我错过了什么?
我已经开始将AMP概念集成到我目前的Magento实时项目中.
我做过以下事情.
这里建议的www文件夹中的一个测试html文件,https://www.ampproject.org/docs/get_started/create/basic_markup.html这很有用.
我在magento项目中用1column.phtml做过,
<!DOCTYPE html>
<html amp lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">
Run Code Online (Sandbox Code Playgroud)
在head.phtml中,添加第一行如下
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
<link rel="canonical" href="http://www.example.com" />
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "NewsArticle",
"headline": "Open-source framework for publishing content",
"datePublished": "2015-10-07T12:02:41Z",
"image": [
"logo.jpg"
]
}
</script>
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal …Run Code Online (Sandbox Code Playgroud) 我想在我的第一个AMP项目中解决这个问题,
这是我的问题:
error.js:58:
Origin of <amp-iframe> must not be equal to container
Run Code Online (Sandbox Code Playgroud)
这是我的index.html中的amp-iframe代码:
<amp-iframe
width=100
height=100
layout="nodisplay"
sandbox="allow-same-origin allow-forms allow-scripts"
src="https://www.example.com/scripts/app.js">
</amp-iframe>
Run Code Online (Sandbox Code Playgroud)
当我浏览控制台选项卡时,这就是我所拥有的:
Powered by AMP ? HTML – Version 1462999126709
AMP validation successful.
Run Code Online (Sandbox Code Playgroud)
我曾经<amp-iframe>使用外部javascript,我的custom.js
我目前正在使我的网站成为AMP的过程中,我的网站是内置于引导程序中的,并且所有内容都具有响应性,因此我设置的大多数图像都是这样的:
img{
width:100%;
height:auto;
}
Run Code Online (Sandbox Code Playgroud)
但是我amp-img遇到的问题是它需要在图像上设置width和height。在amp没有设置height和的情况下,是否有做响应图像的正确方法是width什么?
为什么<amp-sidebar>要成为身体的直接孩子?
我处于一种情况,在代码结构方面,我将更容易包含<amp-sidebar>在一个<div>.我希望它的行为完全像<amp-sidebar>,但我没有任何简单的方法将元素放置为a的直接子元素<body>.
当我看到这个逐个示例的页面没有通过AMP验证器时,我特别困惑.
有人可以照亮我吗?我想在github上打开一个问题,但我不确定是否有错误.
我想用角度5创建一个电子商务渐进式网络应用程序.如何在Google Material Design Lite中使用带有角度5的AMP?如果它不具有可扩展性或可行性,那么其他有什么好的选择呢?
有3种方式,以AMP与PWA(如上所述结合在这里):
在第一种和第三种方法中,我们都是使用Service Worker从服务器中获取AMP内容,并根据需要对其进行修改并进行渲染。有人可以解释一下这些方法之间的区别吗?“ Shadow AMP” API的确切用途是什么?
据我所知,无法将数据存储在 AMP Page 的本地存储中。
用户个性化设置识别的最佳解决方案是什么?
在使用服务器端解决方案时,例如 amp-list,是否意味着用户必须在某种程度上注册或登录?
amp-html ×10
html ×2
angular ×1
architecture ×1
cors ×1
css ×1
javascript ×1
magento ×1
php ×1
seo ×1
share-button ×1