Comparing version 0.2.1 to 0.2.2
17
index.js
@@ -12,4 +12,5 @@ var cheerio = require('cheerio'); | ||
var round; | ||
var options = {}, $; | ||
var $, round; | ||
var options = options || {}; | ||
options.normalizeWhitespace = options.normalizeWhitespace || false; | ||
@@ -36,2 +37,14 @@ options.xmlMode = options.xmlMode || false; | ||
/* head */ | ||
/* adding meta */ | ||
if ($('head meta[charset="utf-8"]').length === 0) { | ||
$('head').append('<meta charset="utf-8">'); | ||
} | ||
/* adding main amp library */ | ||
if ($('head script[src="https://cdn.ampproject.org/v0.js"]').length === 0) { | ||
$('head').append('<script async src="https://cdn.ampproject.org/v0.js"></script>'); | ||
} | ||
/* img dimensions */ | ||
@@ -38,0 +51,0 @@ $('img:not(width):not(height)').each(function() { |
{ | ||
"name": "ampify", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Convert plain HTML to Google Accelerated Mobile Pages (AMP)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# ampify | ||
[![npm version][npm-image]][npm-url] | ||
[![NPM Version][npm-image]][npm-url] | ||
[![Downloads Stats][npm-downloads]][npm-url] | ||
@@ -7,3 +8,5 @@ > Convert plain HTML to Google Accelerated Mobile Pages (AMP). | ||
## Installation | ||
`npm install ampify --save-dev` | ||
```sh | ||
npm install ampify --save-dev | ||
``` | ||
@@ -46,2 +49,17 @@ ## Usage | ||
## Release History | ||
* 0.2.2 | ||
* ADD: meta tag charset | ||
* ADD: AMP library script tag | ||
* BUG: Options parameter not passing | ||
* 0.2.1 | ||
* ADD: inline styles | ||
* ADD: amp-img tag | ||
* ADD: amp-video tag | ||
* ADD: unit tests | ||
* 0.1.0 | ||
* ADD: AMP HTML tag | ||
* Work in progress | ||
## Licence | ||
@@ -52,2 +70,3 @@ MIT (c) Ruslan Kazakov | ||
[npm-url]: https://www.npmjs.org/package/ampify | ||
[npm-image]: http://img.shields.io/npm/v/ampify.svg?style=flat-square | ||
[npm-image]: https://img.shields.io/npm/v/ampify.svg?style=flat-square | ||
[npm-downloads]: https://img.shields.io/npm/dm/ampify.svg?style=flat-square |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70
1
6896
6
105