项目作者: rkazakov

项目描述 :
Postxml plugin to convert plain HTML to Google AMP (Accelerated Mobile Pages)
高级语言: JavaScript
项目地址: git://github.com/rkazakov/postxml-amp.git
创建时间: 2016-02-24T04:57:29Z
项目社区:https://github.com/rkazakov/postxml-amp

开源协议:MIT License

下载


postxml-amp

npm version
Downloads Stats

Build Status
tested with jest
Known Vulnerabilities
Greenkeeper badge

PostXML plugin to convert plain HTML to Google Accelerated Mobile Pages (AMP).

Installation

  1. npm install postxml-amp --save

Usage

Postxml

Options

cwd

Assets (images/styles) file path

  • Type: String
  • Default: ''

round

Enable images dimensions rounding

  • Type: String
  • Default: true

Example

Input

  1. <html>
  2. <head>
  3. <link rel="stylesheet" href="style.css">
  4. </head>
  5. <img src="image.png">
  6. </html>

image.png

image.png

style.css

  1. body {
  2. background-color: #fff;
  3. }

Output

  1. <html amp="">
  2. <head>
  3. <style amp-custom="">body{background-color:#fff}</style>
  4. </head>
  5. <amp-img src="image.png" width="600" height="400"></amp-img>
  6. </html>

Release History

HISTORY

Licence

MIT (c) Ruslan Kazakov