trendyminds/amplify

Twig filter for the Craft CMS 3 to optimize rich text content for Google AMP.

Installs: 3 311

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 6

Forks: 5

Type:craft-plugin

1.0.10 2020-05-27 14:39 UTC

This package is auto-updated.

Last update: 2024-10-28 00:32:00 UTC


README

Matt Adams's Amplify plugin ported to Craft 3, improved to support responsive images and iframes.

Install

  • Install with Composer via: composer require trendyminds/amplify
  • Navigate to Settings -> Plugins and click the "Install" button

Features

The plugin uses a Twig filter to run through the AMP filter settings. To add this to your template, you will need to apply the filter like so:

{{ entry.body|amplify|raw }}

By default, this plugin will find and replace image, video, and audio tags with their Google AMP counterparts. The plugin also strips non AMP approved tags from the copy and adds layout="responsive" to amp images to enable responsive image layouts.