gatsby-plugin-amp icon indicating copy to clipboard operation
gatsby-plugin-amp copied to clipboard

Pathidentifier not working

Open mustofa-binary opened this issue 4 years ago • 1 comments

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 avatar Apr 19 '20 12:04 mustofa-binary

@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,
      },

rshemant avatar Jun 27 '20 10:06 rshemant