Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pathidentifier not working #34

Open
mustofa-binary opened this issue Apr 19, 2020 · 1 comment
Open

Pathidentifier not working #34

mustofa-binary opened this issue Apr 19, 2020 · 1 comment

Comments

@mustofa-binary
Copy link

mustofa-binary commented Apr 19, 2020

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

@rshemant
Copy link
Contributor

rshemant commented Jun 27, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants