2016-03-25 29 views
2

我一直在閱讀AMP的可能性,但我似乎無法理解爲什麼我的頁面沒有顯示,就像Google在其演示中顯示的那樣(請參閱http://g.co/amp)。我的正常的網頁是這樣的:AMP-html頁面在Google搜索中沒有按照預期顯示

<!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> 

它這樣表示在谷歌搜索,並在AMP演示。我知道我的網頁是由Google緩存的:https://cdn.ampproject.org/c/amptest.millerpreview.nl/indexamp.html。在本地,我的AMP已經過驗證,但在緩存版本中,它表示腳本標記無效,即使這是AMP引擎javascript,應該視爲有效。

我的問題;這是不是還沒有在谷歌搜索實施,或者我做錯了什麼?

我的谷歌搜索結果看起來是這樣的:

Google search result

+0

請不要看內容;我只需要快速設置一個儘可能簡單的例子。我甚至無恥地添加了我在Google上發現的最醜陋的圖像,僅僅是出於測試的原因。 –

回答

4

目前AMP頁面的使用受到限制。例如,Google搜索結果不會顯示與AMP等價的頁面。

他們實施的一個地方是在「頭條新聞」的旋轉木馬中。此傳送帶將鏈接到AMP頁面,並將另外顯示到常規搜索結果(它將繼續鏈接到非AMP版本 - 編輯:不再按上述方式)。這隻會顯示NewsArticle帖子的頁面,並且只有當谷歌認爲搜索可能需要最近的新聞列表(因此搜索您的公司不太可能顯示此內容)時纔會顯示NewsArticle帖子的頁面。最近在新聞中搜索某些內容,您應該可以在文章的某篇文章旁看到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 - 至少適用於手機。所以現在超越新聞機構的好處。然而,答案會像當初回答用戶的問題一樣留下答案。

+0

不錯,謝謝你的巨大解釋!你有沒有碰到你的陳述來源?我也將寫一篇關於AMP的博客,然後我可以備份我的數據:-) –

+1

此鏈接僅顯示現在的頂級新聞:https://googleblog.blogspot.com/2016/02/amping-向上的,移動search.html。除了我已經提供的鏈接之外,休息是猜想。您可能有興趣查看我自己的博客文章:https://www.tunetheweb.com/blog/do-we-really-need-google-amp/和https://www.tunetheweb.com/blog/implementing -accelerated-mobile-pages/ –

+0

感謝您的幫助!我一定會檢查你的博客文章。 –

3

使用好東西是Structured Data Testing tool和檢查要求,谷歌顯示搜索這裏:

https://developers.google.com/structured-data/carousels/top-stories#top_stories_with_amp_in_google_search

它看起來像一個潛在的問題是您正在使用ScholarlyArticle,但目前Google只明確列出Article,NewsArticle或BlogPosting。你可以嘗試使用更通用的文章類型,看看是否有效。

如果這樣做無效,那麼可以在Search Console中的Webmaster Central ForumsAMP Error Reports獲取幫助。

2

如果您所指的是cdn.ampproject.org上的頁面未驗證,換句話說https://cdn.ampproject.org/c/amptest.millerpreview.nl/indexamp.html#development=1在開發控制檯中顯示錯誤,這是意圖。 cdn.ampproject.org將JavaScript URL重寫爲具有更長緩存生存期的特定版本的URL。這意味着轉換後的文檔不再有效,但沒關係。您的文件仍被視爲有效。

請參閱https://cdn.ampproject.org/c/example.com/以獲取如果您的頁面實際上無效AMP會發生什麼情況的示例。