Problem
I get validation errors(more errors when logged out) that says:
Error 1 - The mandatory tag 'link rel=canonical' is missing or incorrect at line "what ever the last line is", e.g. line 218
When I view the page source, the last line as identified by the error has extra <body></body> tags at the bottom of the page that I can't seem to remove.
The other validation error I see also at "what ever the last line is":
Error 2 - The mandatory tag 'amphtml engine script' is missing or incorrect.
This also results in some pages not displaying the Logo, and other block regions.
To fix Error 2:
In the html.html.twig file, I remove: <js-placeholder token="{{ placeholder_token }}">
and replace it with:
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-sidebar" src="https://cdn.ampproject.org/v0/amp-sidebar-0.1.js"></script>I there another way to fix this?
If it helps:
I'm using the AMP module version 8.x-3.5 with the following settings:
AMP Theme: is a customized copy of the ExAMPle subtheme. In my custom template I added a html.html.twig file copied from the AMP Base theme so that I could add:
<script async="" custom-element="amp-sticky-ad" src="https://cdn.ampproject.org/v0/amp-sticky-ad-1.0.js"></script>
<script async="" custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>
Under Content Type I have my content types configured for AMP
AMP Library Test says it's configured correctly
Advanced/Experimental Options I have both options selected.
Advanced option(not recommended) is selected because we have content with embedded tweets and youtube videos and this option seems to work great at making this work on our AMP pages
Experimental option is selected because this works great at keeping our users on the AMP pages - over 95% of our audience is on mobile and we're trying to go AMP only at some stage.
Please can you suggest a solution or possible causes for the errors I noted?
Comments