AMP-html 页面在 Google 搜索中未按预期显示
AMP-html page not displaying as intended in Google Search
我一直在通读 AMP 的可能性,但我似乎无法理解为什么我的页面没有像 Google 在他们的演示中那样显示(参见 http://g.co/amp)。我的常规页面是这样的:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>An example of an AMP Project; a part of a self-writen paper about maintainability</title>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<meta name="language" content="NL"/>
<meta name="description" content="Every software engineering project has a certain degree of maintainability. Period.">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<link rel="amphtml" href="http://amptest.millerpreview.nl/indexamp.html">
<link rel="canonical" href="http://amptest.millerpreview.nl/index.html">
</head>
<body>
<header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/">Another page</a></li>
<li><a href="/">Another other page</a></li>
</ul>
</nav>
<h1>Welcome!</h1>
<img src='http://portal.tugraz.at/portal/page/portal/Files/internationales/Welcome_Center/Welcome_Fotolia_62393747_XXL.jpg' />
</header>
<h2>Maintainability of an Open Source Software Engineering Project</h2>
<p>
<b>Every software engineering project has a certain degree of maintainability which is directly derivable to the quality of the software, the complexity of the code, the amount and quality of the documentation and the understandability. In this paper, the maintainability of a randomly chosen open source Android application called TeamTalk is measured with the SIG Maintainability Model, created by the Software Improvement Group. The conclusion of the paper is an advice on improving maintainability towards the creators of this application.</b>
</p>
<h3>Introduction</h3>
<p>
Every software engineering project has a certain degree of maintainability which is directly derivable to the quality of the software, the complexity of the code, the amount and quality of the documentation and the understandability \cite{Heitlager07}. Maintainability is an often forgotten software quality attribute \cite{Radatz90, Swanson76} but a rather important one. Approximately 40 - 80\% of software`s life cycle is spent on maintainability \cite{Coleman94, Dubey11, Kiewkanya05}. Maintaining an application will cost less time and thus less money if the maintainability is given proper attention.<br />
<br />
The goal of this paper is to gain insight into the maintainability of a randomly chosen open source application; in this case, it is the Android \cite{Android} app TeamTalk \cite{TeamTalk}. For this, we will measure the software quality attributes \cite{ISO} of maintainability; the analyzability, changeability, stability and testability.<br />
<br />
In section 2 we will give more insights about the background of the app TeamTalk and about what the SIG Maintainability Model is. In section 3 the used tools and the approach, based on the SIG Maintainability Model, will be discussed. Section 4 shows and discusses the results, on which an overall adice is given in section 5. The paper will be concluded with a summary of the results and what our advice is for the TeamTalk developers.<br />
</p>
<footer>
<img src='http://www.greetingsfromheart.com/images/bye_bye/bye_bye.gif' />
</footer>
</body>
</html>
我的 AMP html 页面是这样的:
<!doctype html>
<html amp lang="en">
<head>
<meta charset="utf-8">
<title>Hello, AMPs</title>
<link rel="canonical" href="http://amptest.millerpreview.nl/index.html" />
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<meta name="description" content="Every software engineering project has a certain degree of maintainability. Periods.">
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "ScholarlyArticle",
"headline": "Maintainability of an Open Source Software Engineering Project",
"datePublished": "2015-10-07T12:02:41Z",
"image": [
"logo.jpg"
]
}
</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>
main {
margin: 0 auto;
max-width: 620px;
}
</style>
<script async src="https://cdn.ampproject.org/v0.js"></script>
</head>
<body>
<main>
<header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/">Another page</a></li>
<li><a href="/">Another other page</a></li>
</ul>
</nav>
<h1>Welcome!</h1>
<amp-img src='http://portal.tugraz.at/portal/page/portal/Files/internationales/Welcome_Center/Welcome_Fotolia_62393747_XXL.jpg' width="325" height="200"/>
</header>
<h1>Maintainability of an Open Source Software Engineering Project</h1>
<p>
<b>Every software engineering project has a certain degree of maintainability which is directly derivable to the quality of the software, the complexity of the code, the amount and quality of the documentation and the understandability. In this paper, the maintainability of a randomly chosen open source Android application called TeamTalk is measured with the SIG Maintainability Model, created by the Software Improvement Group. The conclusion of the paper is an advice on improving maintainability towards the creators of this application.</b>
</p>
<h3>Introduction</h3>
<p>
Every software engineering project has a certain degree of maintainability which is directly derivable to the quality of the software, the complexity of the code, the amount and quality of the documentation and the understandability \cite{Heitlager07}. Maintainability is an often forgotten software quality attribute \cite{Radatz90, Swanson76} but a rather important one. Approximately 40 - 80\% of software`s life cycle is spent on maintainability \cite{Coleman94, Dubey11, Kiewkanya05}. Maintaining an application will cost less time and thus less money if the maintainability is given proper attention.<br />
<br />
The goal of this paper is to gain insight into the maintainability of a randomly chosen open source application; in this case, it is the Android \cite{Android} app TeamTalk \cite{TeamTalk}. For this, we will measure the software quality attributes \cite{ISO} of maintainability; the analyzability, changeability, stability and testability.<br />
<br />
In section 2 we will give more insights about the background of the app TeamTalk and about what the SIG Maintainability Model is. In section 3 the used tools and the approach, based on the SIG Maintainability Model, will be discussed. Section 4 shows and discusses the results, on which an overall adice is given in section 5. The paper will be concluded with a summary of the results and what our advice is for the TeamTalk developers.<br />
</p>
</main>
</body>
</html>
它在 Google 搜索和 AMP 演示中显示如下。我知道我的页面由 Google: https://cdn.ampproject.org/c/amptest.millerpreview.nl/indexamp.html 缓存。在本地,我的 AMP 已通过验证,但在缓存版本中它表示脚本标记无效,即使那是 AMP 引擎 javascript,这应该被视为有效。
我的问题;这在 Google 搜索中尚未实现,还是我做错了什么?
我的 Google 搜索结果如下所示:
使用 Structured Data Testing tool 的一个好东西,并检查要在 Google 中显示的要求 在这里搜索:
看起来一个潜在的问题是您正在使用 ScholarlyArticle,但目前 Google 仅明确列出 Article、NewsArticle 或 BlogPosting。您可以尝试使用更通用的 Article 类型,看看是否可行。
如果这不起作用,获取帮助的好地方是 Search Console 中的 Webmaster Central Forums and in the AMP Error Reports。
目前 AMP 页面的使用受到限制。 Google 例如,搜索结果将不会显示 AMP 等效文件,而不是您的网页。
实施它们的一个地方是在 "Top Stories" 的轮播中。此轮播将 link 显示到 AMP 页面,并将显示 除了 常规搜索结果(将继续 link 显示非 AMP 版本 - 编辑:不再像上面那样了)。这将仅显示 NewsArticle 发布的页面,并且仅当 Google 认为搜索可能需要最新新闻列表时(因此搜索您的公司不太可能显示此内容)。搜索最近的新闻,您应该会看到热门故事轮播和文章中某些文章旁边的闪电。请注意,这还没有在所有地方推出,所以如果您没有看到这个,请尝试 Google.com 而不是 Google.nl。
因此,目前实施 AMP 的主要好处是新闻机构。
这会改变吗?很可能。 Twitter have stated they will start to use the AMP versions、Google 可能会更多地使用它(尽管不确定它们是否会取代主要的搜索列表),其他人可能会效仿。
关于缓存版本中脚本标记的问题,我没有看到该问题。请注意,缓存版本不会经常更新,因此它不是 "live"。所以如果你有错误,访问缓存的URL,它会加载它并显示错误。但是,如果您随后修复错误并刷新缓存 URL,它仍会显示错误。您只需要等待一两天,直到它从缓存中消失,然后重试。他们正在研究一种更好的方法来控制它(尽管似乎有 closed the issue tracking this)。
编辑:自撰写此答案以来发生了很多变化。 Now amp pages DO show in main search results - 至少对于移动设备而言。因此,现在有一个超越新闻机构的好处。但是将保留答案,因为它当时确实回答了用户的问题。
如果您指的是 cdn.ampproject.org 上的页面未验证,换句话说 https://cdn.ampproject.org/c/amptest.millerpreview.nl/indexamp.html#development=1 在开发控制台中显示错误,这是有意的。 cdn.ampproject.org 将 javascript URL 重写为具有更长缓存生命周期的特定版本。这意味着转换后的文档不再有效,但没关系。您的文件仍然有效。
请参阅 https://cdn.ampproject.org/c/example.com/ 以了解如果您的网页实际上是无效 AMP 会发生什么情况的示例。
我一直在通读 AMP 的可能性,但我似乎无法理解为什么我的页面没有像 Google 在他们的演示中那样显示(参见 http://g.co/amp)。我的常规页面是这样的:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>An example of an AMP Project; a part of a self-writen paper about maintainability</title>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<meta name="language" content="NL"/>
<meta name="description" content="Every software engineering project has a certain degree of maintainability. Period.">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<link rel="amphtml" href="http://amptest.millerpreview.nl/indexamp.html">
<link rel="canonical" href="http://amptest.millerpreview.nl/index.html">
</head>
<body>
<header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/">Another page</a></li>
<li><a href="/">Another other page</a></li>
</ul>
</nav>
<h1>Welcome!</h1>
<img src='http://portal.tugraz.at/portal/page/portal/Files/internationales/Welcome_Center/Welcome_Fotolia_62393747_XXL.jpg' />
</header>
<h2>Maintainability of an Open Source Software Engineering Project</h2>
<p>
<b>Every software engineering project has a certain degree of maintainability which is directly derivable to the quality of the software, the complexity of the code, the amount and quality of the documentation and the understandability. In this paper, the maintainability of a randomly chosen open source Android application called TeamTalk is measured with the SIG Maintainability Model, created by the Software Improvement Group. The conclusion of the paper is an advice on improving maintainability towards the creators of this application.</b>
</p>
<h3>Introduction</h3>
<p>
Every software engineering project has a certain degree of maintainability which is directly derivable to the quality of the software, the complexity of the code, the amount and quality of the documentation and the understandability \cite{Heitlager07}. Maintainability is an often forgotten software quality attribute \cite{Radatz90, Swanson76} but a rather important one. Approximately 40 - 80\% of software`s life cycle is spent on maintainability \cite{Coleman94, Dubey11, Kiewkanya05}. Maintaining an application will cost less time and thus less money if the maintainability is given proper attention.<br />
<br />
The goal of this paper is to gain insight into the maintainability of a randomly chosen open source application; in this case, it is the Android \cite{Android} app TeamTalk \cite{TeamTalk}. For this, we will measure the software quality attributes \cite{ISO} of maintainability; the analyzability, changeability, stability and testability.<br />
<br />
In section 2 we will give more insights about the background of the app TeamTalk and about what the SIG Maintainability Model is. In section 3 the used tools and the approach, based on the SIG Maintainability Model, will be discussed. Section 4 shows and discusses the results, on which an overall adice is given in section 5. The paper will be concluded with a summary of the results and what our advice is for the TeamTalk developers.<br />
</p>
<footer>
<img src='http://www.greetingsfromheart.com/images/bye_bye/bye_bye.gif' />
</footer>
</body>
</html>
我的 AMP html 页面是这样的:
<!doctype html>
<html amp lang="en">
<head>
<meta charset="utf-8">
<title>Hello, AMPs</title>
<link rel="canonical" href="http://amptest.millerpreview.nl/index.html" />
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<meta name="description" content="Every software engineering project has a certain degree of maintainability. Periods.">
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "ScholarlyArticle",
"headline": "Maintainability of an Open Source Software Engineering Project",
"datePublished": "2015-10-07T12:02:41Z",
"image": [
"logo.jpg"
]
}
</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>
main {
margin: 0 auto;
max-width: 620px;
}
</style>
<script async src="https://cdn.ampproject.org/v0.js"></script>
</head>
<body>
<main>
<header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/">Another page</a></li>
<li><a href="/">Another other page</a></li>
</ul>
</nav>
<h1>Welcome!</h1>
<amp-img src='http://portal.tugraz.at/portal/page/portal/Files/internationales/Welcome_Center/Welcome_Fotolia_62393747_XXL.jpg' width="325" height="200"/>
</header>
<h1>Maintainability of an Open Source Software Engineering Project</h1>
<p>
<b>Every software engineering project has a certain degree of maintainability which is directly derivable to the quality of the software, the complexity of the code, the amount and quality of the documentation and the understandability. In this paper, the maintainability of a randomly chosen open source Android application called TeamTalk is measured with the SIG Maintainability Model, created by the Software Improvement Group. The conclusion of the paper is an advice on improving maintainability towards the creators of this application.</b>
</p>
<h3>Introduction</h3>
<p>
Every software engineering project has a certain degree of maintainability which is directly derivable to the quality of the software, the complexity of the code, the amount and quality of the documentation and the understandability \cite{Heitlager07}. Maintainability is an often forgotten software quality attribute \cite{Radatz90, Swanson76} but a rather important one. Approximately 40 - 80\% of software`s life cycle is spent on maintainability \cite{Coleman94, Dubey11, Kiewkanya05}. Maintaining an application will cost less time and thus less money if the maintainability is given proper attention.<br />
<br />
The goal of this paper is to gain insight into the maintainability of a randomly chosen open source application; in this case, it is the Android \cite{Android} app TeamTalk \cite{TeamTalk}. For this, we will measure the software quality attributes \cite{ISO} of maintainability; the analyzability, changeability, stability and testability.<br />
<br />
In section 2 we will give more insights about the background of the app TeamTalk and about what the SIG Maintainability Model is. In section 3 the used tools and the approach, based on the SIG Maintainability Model, will be discussed. Section 4 shows and discusses the results, on which an overall adice is given in section 5. The paper will be concluded with a summary of the results and what our advice is for the TeamTalk developers.<br />
</p>
</main>
</body>
</html>
它在 Google 搜索和 AMP 演示中显示如下。我知道我的页面由 Google: https://cdn.ampproject.org/c/amptest.millerpreview.nl/indexamp.html 缓存。在本地,我的 AMP 已通过验证,但在缓存版本中它表示脚本标记无效,即使那是 AMP 引擎 javascript,这应该被视为有效。
我的问题;这在 Google 搜索中尚未实现,还是我做错了什么?
我的 Google 搜索结果如下所示:
使用 Structured Data Testing tool 的一个好东西,并检查要在 Google 中显示的要求 在这里搜索:
看起来一个潜在的问题是您正在使用 ScholarlyArticle,但目前 Google 仅明确列出 Article、NewsArticle 或 BlogPosting。您可以尝试使用更通用的 Article 类型,看看是否可行。
如果这不起作用,获取帮助的好地方是 Search Console 中的 Webmaster Central Forums and in the AMP Error Reports。
目前 AMP 页面的使用受到限制。 Google 例如,搜索结果将不会显示 AMP 等效文件,而不是您的网页。
实施它们的一个地方是在 "Top Stories" 的轮播中。此轮播将 link 显示到 AMP 页面,并将显示 除了 常规搜索结果(将继续 link 显示非 AMP 版本 - 编辑:不再像上面那样了)。这将仅显示 NewsArticle 发布的页面,并且仅当 Google 认为搜索可能需要最新新闻列表时(因此搜索您的公司不太可能显示此内容)。搜索最近的新闻,您应该会看到热门故事轮播和文章中某些文章旁边的闪电。请注意,这还没有在所有地方推出,所以如果您没有看到这个,请尝试 Google.com 而不是 Google.nl。
因此,目前实施 AMP 的主要好处是新闻机构。
这会改变吗?很可能。 Twitter have stated they will start to use the AMP versions、Google 可能会更多地使用它(尽管不确定它们是否会取代主要的搜索列表),其他人可能会效仿。
关于缓存版本中脚本标记的问题,我没有看到该问题。请注意,缓存版本不会经常更新,因此它不是 "live"。所以如果你有错误,访问缓存的URL,它会加载它并显示错误。但是,如果您随后修复错误并刷新缓存 URL,它仍会显示错误。您只需要等待一两天,直到它从缓存中消失,然后重试。他们正在研究一种更好的方法来控制它(尽管似乎有 closed the issue tracking this)。
编辑:自撰写此答案以来发生了很多变化。 Now amp pages DO show in main search results - 至少对于移动设备而言。因此,现在有一个超越新闻机构的好处。但是将保留答案,因为它当时确实回答了用户的问题。
如果您指的是 cdn.ampproject.org 上的页面未验证,换句话说 https://cdn.ampproject.org/c/amptest.millerpreview.nl/indexamp.html#development=1 在开发控制台中显示错误,这是有意的。 cdn.ampproject.org 将 javascript URL 重写为具有更长缓存生命周期的特定版本。这意味着转换后的文档不再有效,但没关系。您的文件仍然有效。
请参阅 https://cdn.ampproject.org/c/example.com/ 以了解如果您的网页实际上是无效 AMP 会发生什么情况的示例。