jafaircl / gatsby-plugin-amp

Gatsby plugin for creating AMP pages
34 stars 32 forks source link

duplicated /amp/amp in the generated amp html #26

Open apotox opened 5 years ago

apotox commented 5 years ago

Hi,

after a successfully build, new AMP pages have been generated and accessible using "http://example.com/page-title/amp ".

but the AMP tag is missing in the <html lang="en">

the view-source of http://example.com/page-title/amp contains:

<link rel="amphtml" href="..../amp/amp"/>

gatsby-config like: { resolve: "gatsby-plugin-amp", options: { canonicalBaseUrl: 'http://example.com/', components: ['amp-form'], excludedPaths: ['/404*', '/'], pathIdentifier: '/amp/', relAmpHtmlPattern: '{{canonicalBaseUrl}}{{pathname}}{{pathIdentifier}}', useAmpClientIdApi: true, } }

gatsby-node like:

createPage({ path: ``${node.path}/amp``, component: bookAmpTemplate, context: { slug: ``${node.path}``, } })

kalwalt commented 4 years ago

I have a similar issue see #25 Did you solved @apotox ?

jonoirwinrsa commented 4 years ago

@apotox I managed to get it working by adding a "/" to the end of the path in createPages

DanOnCall commented 4 years ago

@jonoirwinrsa Saved the day... Been hours trying to make these AMP pages work! That did the trick. Thank you!

I still have to figure out how to make them valid pages 🤔