微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

AMP-html页面未在Google搜索中按预期显示

我一直在阅读AMP的可能性,但我似乎无法理解为什么我的页面没有像谷歌那样在他们的演示中显示它(见 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 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,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,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,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,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搜索结果如下所示:

解决方法

AMP页面的使用目前是有限的.例如,Google搜索结果不会显示AMP等效内容而非您的页面.

他们实施的一个地方是“热门故事”的旋转木马.此轮播将链接到AMP页面,并将显示除常规搜索结果(将继续链接到非AMP版本 – 编辑:不再如上所述).这只会显示NewsArticle帖子的页面,并且只有当Google认为搜索可能需要最近新闻列表时(因此搜索您的公司不太可能显示内容).最近搜索新闻中的某些内容,您应该看到一些Top Stories轮播和一些文章旁边的闪电.请注意,这还没有到处推出,所以如果你没有看到这个,请尝试使用Google.com而不是Google.nl.

因此,目前实施AMP的主​​要好处是新闻机构.

这会改变吗?很可能. Twitter have stated they will start to use the AMP versions,谷歌可能会更多地使用它(虽然不确定它们是否会取代主要的搜索列表),其他人可能会跟随.

至于你在缓存版本中使用脚本标记的问题,我没有看到这个问题.请注意,缓存版本不会经常更新,因此它不是“实时”.因此,如果您有错误,请访问缓存的URL,它将加载它并显示错误.但是,如果您然后修复错误并刷新缓存的URL,它仍将显示错误.你只需要等待一两天,直到它从缓存中掉出来再试一次.他们正在研究一种更好的方法来控制它(虽然似乎有closed the issue tracking this).

编辑:自撰写此答案以来,已经发生了很多变化. Now amp pages DO show in main search results – 至少对于移动设备.所以现在除了新闻机构之外还有其他好处.但是会留下答案,就像它当时回答用户的问题一样.

原文地址:https://www.jb51.cc/html/231644.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐