dev-master
9999999-devProvide AMP HTML conversion to your SilverStripe project
BSD-3-Clause
The Requires
by Nivanka Fonseka
silverstripe conversion amp
Provide AMP HTML conversion to your SilverStripe project
AMP HTML⚡ Bundle - provide AMP HTML conversion to your SilverStripe website., (*1)
Install with composer, (*2)
composer require silverstripers/amp dev-master
To clear the amp caches you need to set up an RSA Key., (*3)
Follow the instructions on the AMP Cache guide on Generating Keys., (*4)
To set up the private key use the following YAML configutation, (*5)
SilverStripers\AMP\Control\AMPCache: key_file: 'PATH_TO_YOUR_PRIVATE_KEY'
The module allows you to set up class name of pages which are supported by AMPs., (*6)
--- Name: amps --- SilverStripers\AMP\Control\AMPDirector: allowed_classes: - SilverStripe\Blog\Model\Blog - SilverStripe\Blog\Model\BlogPost
The configs above limits the amps support to Blog and BlogPost pages., (*7)
This module adds extensions on for your controllers where the pages will have an AMP based version with a URL suffix for each page., (*8)
EG:, (*9)
/home/ will have /home/amp.html /about-us/ will have /about-us/amp.html, (*10)
The mobile also provides a template global $IsAMP
which you can use on any template to add specific HTML segments for the AMP version of the website., (*11)
The module adds cannonical URLs and amphtml links for the sites as well., (*12)
In order to determine whether the current request is in AMP or not you can use $IsAMP
variable., (*13)
<% if $IsAMP %> <!-- YOUR AMP CODES HERE --> <% end_if %>
Same way you can use the not as well, (*14)
<% if not $IsAMP %> <!-- YOUR NONE AMP CODES HERE --> <% end_if %>
The module supports elemental module., (*15)
If you are having to override the templates for Elemental objects you can have templates with _AMP suffix, when those templates are found the elements gets rendered using those., (*16)
Please create an issue for any bugs, or submit merge requests., (*17)
Provide AMP HTML conversion to your SilverStripe project
BSD-3-Clause
silverstripe conversion amp