rsnext/test/integration/amphtml-ssg/pages/blog/[slug].js
2020-05-19 07:58:50 -04:00

27 lines
484 B
JavaScript

import { useAmp } from 'next/amp'
export const config = {
amp: 'hybrid',
}
export const getStaticProps = () => {
return {
props: {
hello: 'hello',
random: Math.random(),
},
}
}
export const getStaticPaths = () => ({
paths: ['/blog/post-1', '/blog/post-2'],
fallback: false,
})
export default ({ hello, random }) => (
<>
<p id="use-amp">useAmp: {useAmp() ? 'yes' : 'no'}</p>
<p id="hello">{hello}</p>
<p id="random">{random}</p>
</>
)