@arc-core-components/amp-document-boilerplate

AMP document boilerplate components

Usage no npm install needed!

<script type="module">
  import arcCoreComponentsAmpDocumentBoilerplate from 'https://cdn.skypack.dev/@arc-core-components/amp-document-boilerplate';
</script>

README

AMP Document boilerplate

Exports

Html

Renders the html node with the attributes required for AMP documents (and all additional attributes supplied as props).

BaseMarkup

Must be rendered as the first child of <head>. Renders the base markup that all AMP documents require.

Props

  • canonicalUrl (string): the canonical URL of the non-AMP version of the page (or the AMP URL if a non-AMP version doesn't exist)

Example usage

import {
  Html,
  BaseMarkup
} from "@arc-core-components/amp-document-boilerplate";

<Html>
  <head>
    <BaseMarkup canonicalUrl="/" />
    {/* add additional head elements here. This is where you would include amp component required scripts. */}
  </head>
  <body>{/* render feature children here */}</body>
</Html>;