我为现有页面添加了一个新的放大器页面。
下面是在我的原始页面中添加的标记
<link rel="canonical" href="https://staging.example.com/blazor">
<link rel="amphtml" href="https://staging.example.com/blazor/amp">
Run Code Online (Sandbox Code Playgroud)
下面是在我的 AMP 页面中添加的标记
<link rel="canonical" href="https://staging.example.com/blazor">
Run Code Online (Sandbox Code Playgroud)
但是,当我在移动设备中打开我的开发网站页面(此页面在robots.txt文件中除外)时,该页面不会重定向到 AMP 页面。
我是否需要为此行为添加任何重定向代码,还是因为我的开发网站页面未在 google 中编入索引?
我的网站托管在IIS 中,并使用ASP.NET MVC Web 应用程序开发
由于我们无法调用外部 css 或引导脚本,如何在 amp 页面中添加模式框?我尝试在 amp 页面中使用 bootstrap,但 amp 验证器失败,因为我们无法在 amp 页面中调用外部 css 脚本!
有没有办法使用备用 CDN 来包含 AMP 需要的主要 JavaScript 文件?可以使用不同的 URLhttps://cdn.ampproject.org/v0.js吗?是否有计划通过允许其他在中国未被屏蔽的 CDN 等方式进一步开放?
使用从网络搜索返回的几个顶级代理,似乎ampproject.org在中国被阻止。这并不奇怪,因为其他 Google 属性被阻止。
编辑:我应该提到我尝试复制文件并在本地运行它,但是当我尝试这样做时 AMP 验证器会引发错误。
我的页面cssAMPed超过 50,000 字节。当我在寻找这个问题的解决方案时,我发现了这个页面cssminifier.com但结果并不令我满意(CSS 确实比以前小,网站工作正常,但仍远未达到允许的大小)。
有人知道这个问题还有其他解决方法吗?
PhpStorm 中是否支持 AMP 项目(由 Google 提供)的自定义标签和属性?
例如<amp-sidebar>,<style amp-custom>...
我有我的 Google 自定义搜索引擎 (GCSE) 代码:
<script>
(function() {
var cx = '008589157460623253837:mhsjluzrngo';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
Run Code Online (Sandbox Code Playgroud)
但是,我的 Accelerated Mobile Pages (AMP) 站点不允许我向其中添加 JavaScript,并且我没有看到任何允许将 GCSE 嵌入到 AMP 站点的 AMP 组件。
如何在不违反 AMP 合规性的情况下在我的网站上获得 GCSE?
谢谢
我正在构建 amp 网站,并使用了 amp-carousel:
https : //ampbyexample.com/components/amp-carousel/
https://www.ampproject.org/es/docs/reference/components/amp-carousel
我正在使用带有“幻灯片”和“自动播放”选项的轮播作为主页的主要横幅,并且我试图在它推进幻灯片时更改动画速度。
有没有办法设置动画速度或者是否有功能要求?
例子:-
<amp-lightbox id="my-lightbox" layout="nodisplay">
<div class="lightbox" on="tap:my-lightbox.close" role="button" tabindex="0">
<amp-iframe width="350" height="300" layout="fixed" sandbox="allow-scripts allow-same-origin allow-popups" frameborder="0" src="https://ampbyexample.com/"></amp-iframe>
</div>
</amp-lightbox>
<button class="ampstart-btn caps m2" on="tap:my-lightbox" role="button" tabindex="0">Open Iframe in Lightbox</button>
Run Code Online (Sandbox Code Playgroud)
我还尝试从顶部操纵 iFrame 75% 或 600px 的位置,但它也不起作用。
AMP iFrame 包含 Jquery UI 日历,我们希望使用它来获取用户在我们的 AMP 页面中选择的交付日期。
是否可以在 AMP iFrame 中获取和传递值?
据我所知,无法将数据存储在 AMP Page 的本地存储中。
用户个性化设置识别的最佳解决方案是什么?
在使用服务器端解决方案时,例如 amp-list,是否意味着用户必须在某种程度上注册或登录?
我尝试安装和运行amp-paywall-demoAmpProject GitHub 存储库中提供的示例失败:https://github.com/ampproject/samples/tree/master/amp-paywall-demo \n我已经在那里提出了问题票,但没有收到任何回复到目前为止(https://github.com/ampproject/samples/issues/211)
我尝试遵循安装指南:我克隆了存储库(这按预期工作),但npm install不幸的是失败了。
我尝试自己调试该错误,但无法做到这一点。 \n我还用 google 搜索了该错误,并在 Git 存储库中的问题中搜索了类似的问题,但这也没有帮助。
\n\n我使用错误的输出以及 debug.log 文件创建了公共要点
\n\n\n\n调试:https://gist.github.com/rafaelmarques7/707f1932f63cd042cdf1e6952c1093ab
\n\n错误堆栈如下:
\n\n\xe2\x9e\x9c amp-paywall-demo git:(master) \xe2\x9c\x97 sudo npm i\n\n> grpc@0.14.1 install /home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/node_modules/gcl\noud/node_modules/grpc\n> node-pre-gyp install --fallback-to-build\n\nnode-pre-gyp info it worked if it ends with ok\nnode-pre-gyp verb cli [ \'/usr/bin/node\',\nnode-pre-gyp verb cli \'/home/rafael/proj/tuts/amp-publisher-sample/amp-paywall-demo/node_modules/\ngcloud/node_modules/grpc/node_modules/.bin/node-pre-gyp\',\nnode-pre-gyp verb cli \'install\',\nnode-pre-gyp verb cli \'--fallback-to-build\' ]\nnode-pre-gyp info using node-pre-gyp@0.6.28\nnode-pre-gyp info using node@10.15.1 | linux | …Run Code Online (Sandbox Code Playgroud) amp-html ×10
asp.net-mvc ×1
c# ×1
css ×1
html ×1
iis ×1
node-pre-gyp ×1
node.js ×1
npm ×1
phpstorm ×1