- AMP:Building Accelerated Mobile Pages
- Ruadhan O'Donoghue
- 133字
- 2021-07-08 10:04:00
Command line validation
If you have Node.js installed on your machine, you can use the command line validation tool to validate both local and remote files. An advantage of this tool is that it can be included in your workflow and deployment process to automatically validate pages, and alert you when unexpected validation failures occur. A process like this will help to ensure that you don't accidentally deploy invalid pages and lose AMP badges and positioning in AMP search results carousels.
You can install the command line validator with the following command:
npm install -g amphtml-validator
To validate a page, use:
amphtml-validator https://theampbook.com
If it validates you will see:
https://theampbook.com: PASS
If there are any validation failures, they are listed just like in the developer console tool:

AMP validation with command line tool
推薦閱讀
- Java語言程序設計
- 極簡算法史:從數學到機器的故事
- Spring 5.0 Microservices(Second Edition)
- Spring Boot+Spring Cloud+Vue+Element項目實戰:手把手教你開發權限管理系統
- 小程序開發原理與實戰
- Unreal Engine 4 Shaders and Effects Cookbook
- Swift 4從零到精通iOS開發
- Scala for Machine Learning(Second Edition)
- Python編程:從入門到實踐(第3版)
- Getting Started with Polymer
- TypeScript 2.x By Example
- Java 從入門到項目實踐(超值版)
- Python+Office:輕松實現Python辦公自動化
- LabVIEW數據采集
- Java RESTful Web Service實戰