AMP

Kod standardowy AMP

head > style[amp-boilerplate] i noscript > style[amp-boilerplate]

Dokumenty AMP HTML muszą zawierać następujący kod standardowy w sekcji head. Walidacja jest obecnie przeprowadzana za pomocą wyrażeń regularnych, więc ważne jest, aby utrzymać modyfikacje na jak najniższym poziomie. Obecnie dozwolone są następujące modyfikacje:

  1. Wstawianie dowolnego odstępu bezpośrednio po otwarciu znacznika style i bezpośrednio przed jego zamknięciem
  2. Zastąpienie dowolnej spacji w poniższym fragmencie dowolnym odstępem.
<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>

W celu szybkiego utworzenia podstawowego szkieletu strony AMP można użyć generatora kodu standardowego. Dostarcza on również fragmenty kodu danych strukturalnych, umożliwiające utworzenie PWA itd.!