amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

AMP with Blogger - The header with xmlns

Open miguelcolomer opened this issue 11 years ago • 3 comments

When i try to use the AMP specification with my Blogger's code i have found some errors in my console with the development mode activated: ´´´´´´ :

AMP validation had errors: validator.js:154 http://www.diariosdelanube.com/:1:0 DISALLOWED_ATTR xmlns (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#ampd)validator.js:154 qd.error

I have seen the referenced link to know how i have to build my "header", and i have a lot of DISALLOWED_ATTR because the Blogger's nature of my code. what can i do to do it "AMP compliance"?:

For example, this is my "header definition" in Blogger:

<?xml version="1.0" encoding="UTF-8" ?>
<html expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>

<b:if cond='data:blog.pageType == &quot;index&quot;'>
<meta content='Diarios de la nube es la web de ayuda al Blogger con guías para no iniciados en informática y contenido inédito en Internet para los más expertos.' name='description'/>
<meta content='blogger, guias, tutoriales, blog, seo, redes sociales, redndimiento, css, tecnologia' name='keywords'/>
<meta content='Diarios de la nube es la web de ayuda al Blogger con guías para no iniciados en informática y contenido inédito en Internet para los más expertos.' property='og:description'/>
<meta expr:content='data:blog.pageName' name='DC.title'/>
</b:if>

<meta content='width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0' name='viewport'/>

PROBLEM Nº1) The "HTML" header:

<html expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>

The xmlns='http://www.w3.org/1999/xhtml' attribute it's not admited by the validator.js. I have to change all the html header with this to pass the validator:

<html amp='' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>

I have to add amp=' ' because the Blogger's code validator doesn't allow me to add <html amp> or <html ⚡> top level tag. And If i add the amp=' ' in my html top level tag i get this error in the amp's validator:

http://www.diariosdelanube.com/:1:0 DISALLOWED_ATTR amp validator.js:154 qd.error

is it possible to use amp code with the blogger's specification?

What can i do to it well?

Thank you very much!!!

miguelcolomer avatar Oct 27 '15 07:10 miguelcolomer

Can you post to StackOverflow with the "amp-html" tag and I'll answer there? Thanks!

jmadler avatar Oct 27 '15 16:10 jmadler

Done!: http://stackoverflow.com/questions/33378225/amp-with-blogger-the-header-with-xmlns

miguelcolomer avatar Oct 27 '15 20:10 miguelcolomer

I don't have any response about this... someone could help?

miguelcolomer avatar Oct 29 '15 07:10 miguelcolomer