- 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
推薦閱讀
- Spring Boot 2實戰之旅
- Learning Linux Binary Analysis
- Visual Basic程序設計教程
- Python漫游數學王國:高等數學、線性代數、數理統計及運籌學
- 網絡爬蟲原理與實踐:基于C#語言
- Go并發編程實戰
- 零基礎看圖學ScratchJr:少兒趣味編程(全彩大字版)
- .NET 4.0面向對象編程漫談:應用篇
- Python機器學習開發實戰
- SQL Server 2008實用教程(第3版)
- Java Web動態網站開發(第2版·微課版)
- Thymeleaf 3完全手冊
- Visual C++程序開發范例寶典
- C語言從入門到精通(第5版)
- 微信小程序開發圖解案例教程:附精講視頻(第3版)