amp-html

Internal links on AMP pages

。_饼干妹妹 提交于 2019-12-11 07:47:27
问题 Many topics on this but can't find a straight answer. How do I hard-code an internal link on my fully AMP validated website? Relative links seem to be converted to absolute. Do I have to link directly to the www.google.com/amp/s/ url? UPDATE: I tried that, and it just redirects to my canonical link. Are we simply not supposed to use internal links? 回答1: Officially, AMP-to-AMP linking is not supported inside the Google AMP Viewer. Theoretically, it's possible to link to the version on the AMP

AMP: The mandatory text (CDATA) inside tag 'head > style[amp-boilerplate]' is missing or incorrect, when using AMP's provided sample code

最后都变了- 提交于 2019-12-11 06:01:46
问题 I'm trying to create an AMP page using this tutorial and all sample code. However, when I go to validate my page, I'm seeing these two errors: Every search I've done for this tells me I need to use this exact string, which is already provided in the tutorial: https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md My sample code is here: http://pastebin.com/VZ1UEs1q What am I doing wrong? The only thing I can think of is that my Visual Studio is auto expanding and formatting

How to add Roboto font to AMP 4 Email

梦想的初衷 提交于 2019-12-11 05:15:20
问题 When I add this, I get an error from The AMP Validator : <link href="https://fonts.googleapis.com/css?family=Roboto+Slab:400,700|Roboto:300,400,500" rel="stylesheet"> The tag 'link' is disallowed. How should I add fonts from Google Fonts inside an amp4email . 回答1: AMP for Email doesn't currently support custom fonts. #21907 is the tracking issue for this feature request. 回答2: Google fonts include to AMP4MAIL by default. You need just change font-family property in your element. For example

Is it possible to serve AMP pages by user agent alone?

谁说我不能喝 提交于 2019-12-11 00:32:33
问题 My website is adaptive, rather than responsive in its construction, with different templates for different user agent classifications (mobile and desktop/tablet). We do this through strong user agent detection and serving the content back with the Vary: user-agent header (as per Google's guidelines) I'd like to keep this structure when creating AMP pages - detecting the user based on their user agent and sending back an AMP template. Is this possible, and if so, what is the user agent that

Why amp-video and amp-audio force the usage of https for src?

痞子三分冷 提交于 2019-12-10 19:35:09
问题 On the documentation about AMP-video this is indicated that: src : Required if no children are present. Must be HTTPS. Why this is needed ? Is this for security issue ? (my video and audio doesn't need security). Is this for performance (and in this case, since when https is faster than http ?) Any other reason ? From my point of view, that look strange to allow the full AMP technology to work on http and only restrict part of them to https. What is the rational behind that ? 回答1: It's a

How to make 'search box which shows list of dynamic option according to data retrieve by get api call on input string' like select2 in amp mail

谁说胖子不能爱 提交于 2019-12-10 19:02:25
问题 I am very new in AMP Email technology and I am facing an issue related to render dynamic options inside search box which makes get API request call as query according to input string and show options list according to data retrieve by request. I came to know that amp-autocomplete is not working in amp-email and I use this code. So, please consider this and suggest a way how to solve this problem. <div> <amp-state id="name"></amp-state> <input id="name-input" placeholder="Search name..." on=

Do I have to maintain two versions of website when I want to use AMPed version on mobile?

社会主义新天地 提交于 2019-12-10 15:13:12
问题 Consider that I have a website with some subpages that I want to accelerate on mobile using AMP. Do I have to maintain two versions of this subpages one with AMP e.g. using amp-img and one without (with img)? 回答1: Yes, note that some of the features of non-AMP HTML won't run on AMP pages like 3rd party Javascript. So on your AMP pages, you'll be doing validations. You also need to know how to link your non-AMP to your AMP pages. 回答2: Yes, this is what has been happening so far for most of the

Is using media queries to switch amp-img a recommended practice?

霸气de小男生 提交于 2019-12-10 11:31:30
问题 An example <amp-img media="(min-width: 650px)" src="wide.jpg" width=466 height=355 layout="responsive" > </amp-img> <amp-img media="(max-width: 649px)" src="wide.jpg" width=527 height=193 layout="responsive" > </amp-img> Now are we not polluting the HTML by repeating them, it can be done with layout fill and giving parent wrapper desired height on media change for example /*figure can be given desired height and width on media queries */ <figure> <amp-img src="wide.jpg" layout="fill" > </amp

AMP Project - Google Analytics - Content Grouping amp-analytics code

爷,独闯天下 提交于 2019-12-10 11:15:15
问题 I am trying to assign content grouping variable to my Google Analytics code in my AMP markup. My AMP analytics code: <amp-analytics type="googleanalytics" id="analyticsgoogle1"> <script type="application/json"> { "vars": { "account": "UA-XXXXXXXX-X" }, "triggers": { "trackPageview": { "on": "visible", "request": "pageview" } } } </script> </amp-analytics> My regular Google analytics code: <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[])

Google AMP with React

北慕城南 提交于 2019-12-09 04:39:24
问题 We have an isomorphic react App with node. I want to convert some pages to AMP pages. I am confused! Shall we go for a separate AMP version of the app or shall we modify the current app according to Google guidelines for AMP Pages? I can see we have to make a lot of changes in the current app to make an amp compatible version. How should I proceed? 回答1: So AMP stands for Accelerated Mobile Pages, NOT Accelerated Mobile Apps. It will be difficult to get a dynamic App 1:1 into AMP. So you need