讓您的網頁更容易被搜尋到
在某些情況下,您可能會想要同時擁有同一個網頁的非 AMP 版本和 AMP 版本,例如新聞報導。請思考這個問題:如果 Google 搜尋找到該網頁的非 AMP 版本,它如何知道有 AMP 版本呢?
使用 <link> 連結網頁
為了解決這個問題,我們以 <head>
中的 <link>
標籤形式,將 AMP 網頁的相關資訊新增到非 AMP 網頁,反之亦然。
將以下內容新增到非 AMP 網頁
<link rel="amphtml" href="https://www.example.com/url/to/amp/document.html">
並將以下內容新增到 AMP 網頁
<link rel="canonical" href="https://www.example.com/url/to/full/document.html">
如果我只有一個網頁怎麼辦?
如果您只有一個網頁,而且該網頁是 AMP 網頁,您仍然必須新增標準連結到該網頁,然後該連結會直接指向自身
<link rel="canonical" href="https://www.example.com/url/to/amp/document.html">
繼續閱讀 – 在 AMP 網頁的 Google 搜尋指南 中深入瞭解 Google 如何找到 AMP 網頁。
透過額外的中繼資料與第三方平台整合
有時,第三方網站 (嵌入您的 AMP 網頁或包含其連結) 除了知道您的網頁是 AMP 網頁之外,還需要瞭解更多關於您的網頁的資訊。平台可能會詢問關於您的網頁的問題,例如「您是新聞報導嗎?」、「還是影片?」或「您有螢幕截圖和簡短說明嗎?」。
這不僅與 AMP 網頁相關,也與所有網頁相關。對於某些平台而言,這種中繼資料是額外的,對於其他平台而言,這是必要條件,也就是說,如果您未包含正確的中繼資料,它們就不會顯示您內容的連結。請確定您為想要顯示內容的平台包含正確的中繼資料。
針對大多數搜尋引擎使用 Schema.org
Schema.org 提供開放詞彙來為各種事物新增中繼資料。在 AMP 的情況下,在內容脈絡中有意義的屬性包括特定內容類型 (即「新聞報導」)、標題、發佈日期和相關的預覽圖片。
範例
<script type="application/ld+json"> { "@context": "http://schema.org", "@type": "NewsArticle", "mainEntityOfPage": "http://cdn.ampproject.org/article-metadata.html", "headline": "Lorem Ipsum", "datePublished": "1907-05-05T12:02:41Z", "dateModified": "1907-05-05T12:02:41Z", "description": "The Catiline Orations continue to beguile engineers and designers alike -- but can it stand the test of time?", "author": { "@type": "Person", "name": "Jordan M Adler" }, "publisher": { "@type": "Organization", "name": "Google", "logo": { "@type": "ImageObject", "url": "http://cdn.ampproject.org/logo.jpg", "width": 600, "height": 60 } }, "image": { "@type": "ImageObject", "url": "http://cdn.ampproject.org/leader.jpg", "height": 2000, "width": 800 } } </script>
更多範例可以在 ampproject 範例資料夾 中找到,包括替代的 HTML 屬性語法)。
請造訪這些資源以取得關於結構化資料的更多資訊
- 瞭解如何建構您的內容,使其顯示在 Google 搜尋的複合式搜尋結果中 (例如,熱門新聞輪播、食譜卡片等)。
- 使用 Google 結構化資料測試工具 測試您的結構化資料。
適用於更多平台的其他中繼資料
前往 Web Fundamentals 上的社交探索指南,瞭解準備您的內容以進行探索和散佈的所有其他不同方式。