gatsby-plugin-amp
gatsby-plugin-amp copied to clipboard
Pathidentifier not working
Sorry, i am new to amp. When pathIdentifier is eg. /amp/
, the /amp route doesnt have amp powered html, if i change it to /
, all pages will have amp powered html. i want only /amp/ pages will use amp. strangely, it only happens on develop
(local), when i push to netlify, it works fine
@mustofa-binary just use "/amp",
remove last slash. It will work.
example:
{
resolve: `gatsby-plugin-amp`,
options: {
analytics: {
type: "gtag",
dataCredentials: "include",
config: {
vars: {
gtag_id: "UA-XX-1",
config: {
"UA-XX-1": {
page_location: "{{pathname}}",
},
},
},
},
},
canonicalBaseUrl: "http://www.example.com/",
components: ["amp-form"],
excludedPaths: ["/404*", "/"],
pathIdentifier: **"/amp",**
relAmpHtmlPattern: "{{canonicalBaseUrl}}{{pathname}}{{pathIdentifier}}",
useAmpClientIdApi: true,
},