Download the PHP package arrowsgm/amped-laravel without Composer
On this page you can find all versions of the php package arrowsgm/amped-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download arrowsgm/amped-laravel
More information about arrowsgm/amped-laravel
Files in arrowsgm/amped-laravel
Package amped-laravel
Short Description An HTML to AMP converter for Laravel based on amp-wp Wordpress plugin
License GPL-2.0-or-later
Informations about the package amped-laravel
Amped Laravel
This package adds possibility to convert existing html content to amp-html. The package uses AMP Plugin for WordPress for content sanitizing and some helper functions from Wordpress for amp-wp plugin.
AMP is a fast-growing framework, but unfortunately, currently, there are no (or at least I can't find it) any working solutions, which can help to provide a valid html to amp-html code converter. According to ampproject/amp-wp#2315, @amproject is preparing to release a PHP-library independent from any CMS, but until that time using amp-wp plugin as a content sanitizer is an easiest solution, even if it has many Wordpress-related code. If you have any issue with package sanitizer, you can easily swap it with your own, just making changes in provided config.
Requirements
- PHP >= 7.3
- Laravel >= 6.x
Update from versions < 0.4.x
You need to change repository url in your composer.json from https://github.com/ampproject/amp-wp
to https://github.com/arrowsgm/amp-wp
, this is a hard-forked version 1.4.4 of the ampproject/amp-wp
package with updated dependencies.
Installation
Add to your composer.json
repositories section link to amp-wp plugin:
when require package as usual:
Using
You can publish configuration with artisan command:
or just create amped.php
file in the config
directory and change required params only.
To convert existing content use provided Amped
facade:
You can use Amped
facade in the blade templates, alias already provided:
Amped
class also have inlineCss
method to adding custom styles from css file:
and you can set base amp styles directory with amp_custom_css_path
config param.
isDevParam
method is useful for amp link building. It returns #development=1
string if laravel application debugging is on:
and you can easily navigate through the existing posts with in-browser AMP validation enabled.
All versions of amped-laravel with dependencies
ext-libxml Version *
ext-dom Version *
ext-json Version *
guzzlehttp/guzzle Version ~6.0|^7.0