- AMP:Building Accelerated Mobile Pages
- Ruadhan O'Donoghue
- 167字
- 2021-07-08 10:03:56
Optional but recommended boilerplate
The following items are not required in AMP pages, but are recommended so that you get the most SEO benefit from your web pages:
- Title tag: Title tags are used as a ranking signal in search engines, and are useful to users in identifying pages. You can add the title tag right after the AMP-JS <script> tag:
<title>Hello World!</title>
- Structured metadata: Adding structured metadata allows third-party services to more efficiently index and preview your pages. For example, Facebook uses the Open Graph Protocol, while Twitter uses Twitter Cards, to extract images and specific data about your page. Additionally, Google's Top Stories Carousel supports the schema.org Article and Video categories to generate article previews such as the ones shown in the next section.
To get a structured metadata preview of your page in Google search results, you need to add code similar to this to the head of your page:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "NewsArticle",
"headline": "Article headline",
"image": [
"thumbnail1.jpg"
],
"datePublished": "2017-03-01T08:00:00+08:00"
}
</script>
推薦閱讀
- Functional Python Programming
- Node.js 10實戰
- Microsoft Application Virtualization Cookbook
- Mastering QGIS
- DevOps入門與實踐
- Apache Karaf Cookbook
- PHP+MySQL網站開發項目式教程
- JavaScript應用開發實踐指南
- 區塊鏈架構之美:從比特幣、以太坊、超級賬本看區塊鏈架構設計
- Delphi開發典型模塊大全(修訂版)
- 程序員的成長課
- Visual C++從入門到精通(第2版)
- React.js實戰
- Microsoft Azure Security
- 軟件自動化測試實戰解析:基于Python3編程語言