- 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
推薦閱讀
- Qt 5 and OpenCV 4 Computer Vision Projects
- JavaScript前端開發模塊化教程
- 深入理解Android(卷I)
- WildFly:New Features
- Python爬蟲開發:從入門到實戰(微課版)
- Xcode 7 Essentials(Second Edition)
- Mastering matplotlib
- Spring Cloud、Nginx高并發核心編程
- Mastering AndEngine Game Development
- Unity 5 for Android Essentials
- 從零開始學Linux編程
- Spring+Spring MVC+MyBatis從零開始學
- Kivy Cookbook
- C# Multithreaded and Parallel Programming
- C++程序設計教程(第2版)