amp-html

How to fix: Referenced AMP URL is not an AMP

此生再无相见时 提交于 2019-12-21 19:56:44
问题 Search console added a bunch of issues with "Referenced AMP URL is not an AMP". If I use the AMP Test I get: However, when I check in https://validator.ampproject.org/ it shows: Here is a list of some of the URLs that the Search Console says are not valid AMP pages: https://www.beek.io/amp/frases/satan-una-autobiografia https://www.beek.io/amp/frases/mi-isla https://www.beek.io/amp/frases/magnus-chase-y-los-dioses-de-asgard-1-la-espada-del-tiempo I don't understand what Google expect me to

AMP: Origin of <amp-iframe> must not be equal to container

一个人想着一个人 提交于 2019-12-21 17:42:16
问题 I want to solve this problem in my first AMP project, This is the problem that I have: error.js:58: Origin of <amp-iframe> must not be equal to container This is my amp-iframe code in my index.html: <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> when I navigate the console tab, this is what I have: Powered by AMP ⚡ HTML – Version 1462999126709 AMP validation successful. I

AMP Newsletter Form Response Issue

∥☆過路亽.° 提交于 2019-12-21 06:57:14
问题 I am trying to implement AMP newsletter subscription form using Reference Link. Once form is submitted, on the server side I use following code to handle the request and return response : Server Side Script : <?php header("Content-type: application/json"); header("Access-Control-Allow-Credentials: true"); header("Access-Control-Allow-Origin: *.ampproject.org"); header("AMP-Access-Control-Allow-Source-Origin: https://www.example.com"); header("Access-Control-Expose-Headers: AMP-Access-Control

Image missing and required - Wordpress AMP Structure doesn't add Image attribute

白昼怎懂夜的黑 提交于 2019-12-20 01:44:08
问题 When validating my wordpress posts using Google's Structured Data Testing Tool, I get the following error: "Image: missing and required" I have the official wordpress AMP plugin installed that generated the AMP pages for me. The problem is that it doesn't popular the "image" attribute for BlogPosting . In the plugin there is a code that I think should generate it, but it's not running anywhere: private function get_post_image_metadata() { $post_image_meta = null; $post_image_id = false; if (

How do I view valid AMP pages in mobile Google search results?

假如想象 提交于 2019-12-19 03:32:54
问题 I've confirmed over 100 valid AMP pages in my site with Google webmaster tools. How do I actually view these pages inside google mobile search results? Googling these pages on my phone only returns the canonical version of these amp pages. Does Google only return a curated set of valid amp pages? 回答1: AMP team member here – I'm pretty sure you are referring to the Top Stories carousel – in which case I have bad news for you. There's no way to guarantee you'll appear in the carousel if you

How do I view valid AMP pages in mobile Google search results?

青春壹個敷衍的年華 提交于 2019-12-19 03:32:13
问题 I've confirmed over 100 valid AMP pages in my site with Google webmaster tools. How do I actually view these pages inside google mobile search results? Googling these pages on my phone only returns the canonical version of these amp pages. Does Google only return a curated set of valid amp pages? 回答1: AMP team member here – I'm pretty sure you are referring to the Top Stories carousel – in which case I have bad news for you. There's no way to guarantee you'll appear in the carousel if you

Disqus on an amp page inside an amp-iframe

你离开我真会死。 提交于 2019-12-18 16:59:48
问题 I try to implement Disqus on an amp document. My idea is to use an amp-iframe which loads a small document which only contains Disqus. I used this amp frame <amp-iframe width="300" height="300" layout="responsive" sandbox="allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-scripts" resizable frameborder="0" seamless src="/disquss/name-of-blog-post"> <div overflow tabindex=0 role=button aria-label="Read more">more!</div> </amp-iframe> However, chrome throws a content

AMP: easy way to toggle a CSS class?

偶尔善良 提交于 2019-12-17 16:07:23
问题 I'm build an Accelerated Mobile Page (AMP) template and was wondering if there is an easy way of toggling a CSS class on tab. I know about stuff like: <h2 class="headline" on="tap:list.toggleVisibility" > <ul id="list"></ul> But this writes inline-styles - I'd rather toggle a custom CSS class but couldn't find an example on the AMP page. AMP.setState with bindings like <h2 [class]="myclasses"> looked like the way to go but manipulating the state is pretty hard with the tools they give you ...

Running JavaScript in AMP

风流意气都作罢 提交于 2019-12-17 09:42:16
问题 I am a bit confused as to how JavaScript is suppposed to be run in an AMP page. I got as far as understanding that my JavaScript must be executed in an iframe. Such iframe has to be placed down in the page (75% at least from top) and has to be served through https. This does indeed work: <amp-iframe width=300 height=300 sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox" layout="responsive" frameborder="0" src="https://localhost:8000/?p=myjs"> </amp-iframe> In that page (

Best way to include custom JavaScript in AMP

百般思念 提交于 2019-12-17 07:27:08
问题 I read all documentation about script tag but I cannot find how to include a custom JavaScript in AMP HTML. I know the <script> tag is prohibited unless its type is application/ld+json . There are default AMP HTML runtime components and extended components which contain specific form for different components, but I could not find a specific one for custom JavaScript. Here is the script tag I want to include in AMP HTML; <script src="https://arifkarim.com/widget/layouts/global/js/legaltext.js"