e5111745b5
* Add WithAmp to enable AMP support for pages instead of .amp.js * Update handling for exporting AMP * Fix ampPath in export for / path and revert isAmp logic to handle right * Update amphtml test suite * Add handling for noDirtyAmp during export and update amp-export test suite * Update serverless and export-default-map test suites * Update require-page tests
26 lines
470 B
JavaScript
26 lines
470 B
JavaScript
import Head from 'next/head'
|
|
import { withAmp } from 'next/amp'
|
|
|
|
const date = new Date().toJSON()
|
|
|
|
export default withAmp(() => (
|
|
<>
|
|
<Head>
|
|
<script
|
|
async
|
|
key='amp-timeago'
|
|
custom-element='amp-timeago'
|
|
src='https://cdn.ampproject.org/v0/amp-timeago-0.1.js'
|
|
/>
|
|
</Head>
|
|
|
|
<amp-timeago
|
|
width='160'
|
|
height='20'
|
|
datetime={date}
|
|
layout='responsive'
|
|
>
|
|
{date}
|
|
</amp-timeago>
|
|
</>
|
|
))
|