Free
Download the package from the manager of your site.
How to download?
The author
Сергей
Packages
2
Downloads
265
Автор дополнения
Packages
2
Downloads
265
Version 1.1.1-pl
Release date 10.12.2021
Downloads 130
Views 909
Warning! This component requires PHP version 7.4 or higher! If your site uses PHP less than required, the installation of this package could break it.
Warning! This package requires MODX not less than 2.8 !

A simple AMP plugin for switching and automatically forming into a simple page. To automatically change the page, a Library was implemented: AMP PHP Library.


System Settings


googleAmpModx_cache — Caching for AMP content;
[by default: Yes ]

googleAmpModx_get — Request Name;
[by default: amp ]

googleAmpModx_template — AMP default template, if no id is specified in the request;
[by default: 0 ]

googleAmpModx_warnings — Print the result in the Error Log.
[by default: No ]


Instruction manual


1. Creating an AMP Page Template:

<!DOCTYPE html>
<html amp lang="ru">
<head>
    <meta charset="utf-8">
    <title>[[*pagetitle]]</title>
	<link rel="canonical" href="/">
	<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
	<style amp-boilerplate> 
		body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{ visibility:hidden}to{ visibility:visible}}@-moz-keyframes -amp-start{ from{ visibility:hidden}to{ visibility:visible}}@-ms-keyframes -amp-start{from{ visibility:hidden}to{ visibility:visible}}@-o-keyframes -amp-start{ from{ visibility:hidden}to{ visibility:visible}}@keyframes -amp-start{ from{visibility:hidden}to{visibility:visible}}
	</style>
	<noscript><style amp-boilerplate>body{ -webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
	<script async src="https://cdn.ampproject.org/v0.js"></script>
    <script async custom-element="amp-sidebar" src="https://cdn.ampproject.org/v0/amp-sidebar-0.1.js"></script>
    <script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js"></script>
    <script async custom-element="amp-youtube" src="https://cdn.ampproject.org/v0/amp-youtube-0.1.js"></script>
</head>
<body>
	<amp-sidebar id="sidebar" layout="nodisplay">
		<div role="button" on="tap:sidebar.close" tabindex="5" class="close">×</div>
		<ul>
			<li role="navigation" tabindex="1"><a href="/" title="Главная страница">Главная страница</a></li>
		</ul>
	</amp-sidebar>	
	<div id="header" class="clearfix">
		<a href="[[++site_url]]" title="[[*pagetitle:escape]]">
			<amp-img src="[[++site_url]]logo.svg" alt="[[*pagetitle:escape]]" width="200" height="40" style="float:right"></amp-img>
		</a>
		<div role="button" on="tap:sidebar.toggle" tabindex="0" id="ham">☰</div>
	</div>
	<div style="margin: 10px;">
		<h1>[[*pagetitle]]</h1>
		[[*content]]
	</div>
	<div id="footer">
		
	</div>
</body></html>


2.If you have one template, then add the request ?amp to the link, do not forget to change the System Settings — id of the AMP template:

<link rel="amphtml" href="https://test.ru/test.html?amp">
<link rel="canonical" href="https://test.ru/test.html" />

Or if you have several templates, then add the request ?amp=14 to the link (14-id template):
<link rel="amphtml" href="https://test.ru/test.html?amp=14">
<link rel="canonical" href="https://test.ru/test.html" />


3. In the file robots.txt allow indexing of AMP pages:

Allow: *?amp


PHP Library-AMP PHP Libraryhttps://github.com/Lullabot/amp-library

1.1.1-pl (12.10.2021)

  • Небольшие правки;

1.1.0-pl (08.10.2021)

  • Небольшие правки;

1.0.9-pl (06.06.2021)

  • Исправлено отображение элемента с модификатором - tag;
  • Плагин не формирует в AMP внутри тега ;

1.0.8-pl (30.12.2020)

  • Добавлен параметр в Системные настройки;
  • Добавлен modParser;

1.0.7-pl (30.12.2020)

  • Небольшие правки;

1.0.6-pl (29.12.2020)

  • Релиз;
  • Добавлено 2 параметра в Системные настройки;
  • Небольшие правки.

1.0.5-beta