Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Validation 使用Umbraco 7模板的AMP页面中出现验证错误_Validation_Umbraco7_Amp Html - Fatal编程技术网

Validation 使用Umbraco 7模板的AMP页面中出现验证错误

Validation 使用Umbraco 7模板的AMP页面中出现验证错误,validation,umbraco7,amp-html,Validation,Umbraco7,Amp Html,同样的问题和症状,但可能是一个不同的原因(答案没有为我提供任何线索),加上我必须创建一个新的问题,因为我刚刚注册。。。现在希望得到帮助:o) 我在验证AMP页面时遇到此验证错误: The mandatory text (CDATA) inside tag 'head > style : boilerplate' is missing or incorrect. 我遵循了所有的指导原则,包括在head部分添加AMP样板代码 验证器指向AMP项目规定的这段代码: <noscript&g

同样的问题和症状,但可能是一个不同的原因(答案没有为我提供任何线索),加上我必须创建一个新的问题,因为我刚刚注册。。。现在希望得到帮助:o)

我在验证AMP页面时遇到此验证错误:

The mandatory text (CDATA) inside tag 'head > style : boilerplate' is missing or incorrect.
我遵循了所有的指导原则,包括在
head
部分添加AMP样板代码

验证器指向AMP项目规定的这段代码:

<noscript><style amp-boilerplate>
     body {
         -webkit-animation: none;
         -moz-animation: none;
         -ms-animation: none;
         animation: none;
     }
</style></noscript>

您需要有完整的amp样板代码

替换您的
多行
样板代码:

   <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style>
<noscript><style amp-boilerplate>
    body {
        -webkit-animation: none;
        -moz-animation: none;
        -ms-animation: none;
        animation: none;
    }
</style></noscript>
您的AMP语法错误:

所需:

The width of the image, in pixels. Images should be at least 696 pixels wide.
建议(如果添加,则通过测试):

另一件重要的事情是,图像的URL不应该是相对路径

以下是您的(已修改-我已替换样板代码和图像链接)html:


布拉赫入选2015年卓越奖
{
“@context”:”http://schema.org",
“@type”:“新闻文章”,
“页面的维护”:http://somedomain.local/news-media/news-media-headlines/2015/oct/blah-shortlisted-at-awards-for-excellence-2015/",
“标题”:“布拉赫入选2015年卓越奖”,
“描述”:“我们很高兴地宣布布拉已被列入……的&#布拉&&#布拉&&#布拉&&#布拉&#奖的候选名单,
“发布日期”:“2015年10月28日上午9:43:57”,
“修改日期”:“2015年10月28日上午9:43:57”,
“作者”:{
“@type”:“组织”,
“名称”:“此处的名称”
},
“出版商”:{
“@type”:“组织”,
“名称”:“此处的名称”,
“徽标”:{
“@type”:“ImageObject”,
“url”:”https://www.somedomain.com/img/logo.png",
“宽度”:600,
“身高”:60
}
},
“图像”:{
“@type”:“ImageObject”,
“url”:”https://www.somedomain.com/img/logo.png",
“高度”:50,
“宽度”:700
}
}
body{-webkit动画:-amp start 8s steps(1,end)0s1 normal tweet;-moz动画:-amp start 8s steps(1,end)0s1 normal tweet;-ms动画:-amp start 8s steps(1,end)0s1 normal tweet}@-webkit关键帧-amp start{从{可见性:隐藏}到{可见性:可见}}@-moz关键帧-amp start{from{可见性:隐藏}
身体{
字体系列:“Roboto”,无衬线;
}
.小标题{
左:1rem;
填充顶部:0;
垫底:1米;
保证金:0;
颜色:#fff;
}
正文>div{
填充:1rem;
}
h1,h2{
颜色:#fff;
填充:1rem;
保证金:0;
}
h1.小标题{
背景色:#009ed4;
}
氢{
背景色:#00618e;
字体大小:400;
字号:1.25em;
}
amp-img{
最大宽度:100%;
}
.标志{
边缘:1米;
}
布拉赫入选2015年卓越奖

2015年10月26日

我们很高兴地宣布。。。 今年是第16个

废话

奥雷姆·伊普斯姆·多洛·希特,一位杰出的预言家。奥古斯·尼布,康格·欧格特的名言,国际间的自由。猫科动物,各种各样的动物都坐在我的位子上。一只大龙虾的门上长着一对智者。一只发情的芦苇,长着一根柔软的权杖。这是我的宿命

“引用这里的话。”奥雷姆·伊普苏姆·多洛·萨特(orem ipsum Door sit amet)是一位杰出的献祭者。奥古斯特·尼布(augue nibh)是一位伟大的领袖,他是一位自由的领袖。他是一位车夫,他是一位伟大的斗士。他是一位智者,他是一位斗士,他是一位杰出的斗士

奥雷姆·伊普斯姆·多洛·希特,一位杰出的预言家。奥古斯·尼布,康格·欧格特的名言,国际间的自由。猫科动物,各种各样的动物都坐在我的位子上。一只大龙虾的门上长着一对智者。一只发情的芦苇,长着一根柔软的权杖。这是我的宿命。
JSON-LD脚本中缺少一个结束符
}
。在publisher
height
之后添加},这是Pawel关于图像URL和JSON-LD错误的非常有用和相关的建议,我用它来纠正我的标记。除此之外,我的具体问题的确切最终原因是将正确的样板代码剪切/粘贴到Visual Studio中的结果。。。VS自动重新格式化代码,并在
标记中的样式中添加空格。这就是验证仍然失败的原因。因此,确保VS不会“有益地”重新格式化-不应该有任何空格字符。唉…

谢谢。但是,我已经使用了您引用的链接中的完整代码,它只是我引用的代码中验证程序发现有问题的部分。您可以跳过我们的整个页面内容吗?更容易调试的问题将是获得最终的html输出,而不是源代码。谢谢,根据下面杰伊·格雷的提示,我也发现了这一点。结构化数据测试现在通过了ok,但AMP验证(即URL上的
#development=1
)仍然像以前一样失败。我已经清除了缓存等,我花了一段时间,我看到了
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
    "publisher": {
            "@type": "Organization",
            "name": "Name here",
            "logo": {
                "@type": "ImageObject",
                "url": "https://www.somedomain.com/img/logo.png",
                "width": 600,
                "height": 60
            } // You forget to close logo object.
     },
The width of the image, in pixels. Images should be at least 696 pixels wide.
The date and time the article was most recently modified, in ISO 8601 format. If the article has never been modified, you can omit this property or use the same date as datePublished.
<!doctype html>
<html amp lang="en">
<head>
    <meta charset="utf-8">
        <title>Blah shortlisted at Awards for Excellence 2015</title>
    <link rel="canonical" href="http://somedomain.local/news-media/news-media-headlines/2015/oct/blah-shortlisted-at-awards-for-excellence-2015/" />
    <link href='https://fonts.googleapis.com/css?family=Roboto:500,400italic,300,700,400|PT+Sans:700' rel='stylesheet' type='text/css'>
    <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
    <script type="application/ld+json">
        {
        "@context": "http://schema.org",
        "@type": "NewsArticle",
        "mainEntityOfPage": "http://somedomain.local/news-media/news-media-headlines/2015/oct/blah-shortlisted-at-awards-for-excellence-2015/",
        "headline": "Blah shortlisted at Awards for Excellence 2015",
        "description": "We&#39;re delighted to announce that Blah has been shortlisted for the &#39;Blah &amp; blah blah&#39; award at the...",
        "datePublished": "10/28/2015 9:43:57 AM",
        "dateModified": "10/28/2015 9:43:57 AM",
        "author": {
                "@type": "Organization",
                "name": "Name here"
            },
        "publisher": {
                "@type": "Organization",
                "name": "Name here",
                "logo": {
                "@type": "ImageObject",
                "url": "https://www.somedomain.com/img/logo.png",
                "width": 600,
                "height": 60
                }
            },
        "image": {
                "@type": "ImageObject",
                "url": "https://www.somedomain.com/img/logo.png",
                "height": 50,
                "width": 700
            }
        }
    </script>
    <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
    <style amp-custom>
        body {
            font-family: 'Roboto', sans-serif;
        }
        .sub-heading {
            padding-left: 1rem;
            padding-top: 0;
            padding-bottom: 1em;
            margin: 0;
            color: #fff;
        }
        body > div {
            padding: 1rem;
        }
        h1, h2 {
            color: #fff;
            padding: 1rem;
            margin: 0;
        }
        h1, .sub-heading {
            background-color: #009ed4;
        }
        h2 {
            background-color: #00618e;
            font-weight: 400;
            font-size: 1.25em;
        }
        amp-img {
            max-width: 100%;
        }
        .logo {
            margin: 1em;
        }
    </style>
    <script async src="https://cdn.ampproject.org/v0.js"></script>
</head>
<body>
    <a href="/"><amp-img width="165" height="50" class="logo" src="http://i.kinja-img.com/gawker-media/image/upload/s--pEKSmwzm--/c_scale,fl_progressive,q_80,w_800/1414228815325188681.jpg" alt="Logo"></amp-img></a>
        <h1>Blah shortlisted at Awards for Excellence 2015</h1>
            <p class="sub-heading">26 October 2015</p>
            <h2>We&#39;re delighted to announce that...</h2>
    <div><p>This year is the 16th... </p>
<p ><amp-img layout="responsive" width="500"height="281" src="http://i.kinja-img.com/gawker-media/image/upload/s--pEKSmwzm--/c_scale,fl_progressive,q_80,w_800/1414228815325188681.jpg"  /></amp-img></p>
<p><a href="http://www.google.co.uk/" target="_blank" title="blah">blah blah</p>
<p ><amp-img layout="responsive" width="500"height="281" src="http://i.kinja-img.com/gawker-media/image/upload/s--pEKSmwzm--/c_scale,fl_progressive,q_80,w_800/1414228815325188681.jpg"  /></amp-img></p>
<p>orem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque augue nibh, congue eu dictum at, interdum et libero. Etiam malesuada vehicula felis, vel varius odio semper sit amet. Phasellus quis sapien sed turpis porta lobortis. Aenean rutrum risus ut scelerisque mollis. Suspendisse id feugiat erat.</p>
<p><amp-img layout="responsive" width="500"height="306.452" src="http://i.kinja-img.com/gawker-media/image/upload/s--pEKSmwzm--/c_scale,fl_progressive,q_80,w_800/1414228815325188681.jpg" alt="alt text here" /></amp-img></p>
<p>"quote here." orem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque augue nibh, congue eu dictum at, interdum et libero. Etiam malesuada vehicula felis, vel varius odio semper sit amet. Phasellus quis sapien sed turpis porta lobortis. Aenean rutrum risus ut scelerisque mollis. Suspendisse id feugiat erat.</p>
<p> </p>
<div>
<div>orem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque augue nibh, congue eu dictum at, interdum et libero. Etiam malesuada vehicula felis, vel varius odio semper sit amet. Phasellus quis sapien sed turpis porta lobortis. Aenean rutrum risus ut scelerisque mollis. Suspendisse id feugiat erat.</div>
</div></div>
</body>
</html>