Convert plain HTML to Google Accelerated Mobile Pages (AMP)
npm install @bradymholt/ampify> Convert plain HTML to Google AMP (Accelerated Mobile Pages)
``sh`
npm install @bradymholt/ampify
`js`
const ampify = require("ampify");
const html = "
const amp = await ampify(html, { cwd: "amp" });
console.log(amp); // Content of AMP HTML
When and tags with a local file reference are encountered, they will read and processed. This option specifies where the files are located (i.e. fs.existsSync(${options.cwd}/${imagSrc})) .
- Type: String''
- Default:
- Type: Stringtrue
- Default:
`html`

`html``