mdx-deck icon indicating copy to clipboard operation
mdx-deck copied to clipboard

Look into properly supporting `pathPrefix` in Gatsby

Open jxnblk opened this issue 6 years ago • 2 comments

While it halfway works, setting pathPrefix in a Gatsby config causes some odd behavior in the theme. This might be due to the use of matchPath + how the base path is passed to React Router

jxnblk avatar Jul 31 '19 18:07 jxnblk

Is this for the basePath options passed through Gatsby Config? If so I think I am running into what you are talking about. It seems to just continue adding that base path on the end of the url.

If I set it to:

    options: {
        basePath: "/slides",
      },

and visit localhost:8000/slides/intro and then click the -> arrow the URL becomes "http://localhost:8000/slides/slides/intro/1"

if I start on http://localhost:8000/slides/intro/1 and hit the <- arrow the URL becomes "http://localhost:8000/slides/intro/slides/intro/0"

I could maybe look into fixing this but im not sure where to start.

liltechnomancer avatar Oct 24 '19 18:10 liltechnomancer

Is this for the basePath options passed through Gatsby Config? If so I think I am running into what you are talking about. It seems to just continue adding that base path on the end of the url.

If I set it to:

    options: {
        basePath: "/slides",
      },

and visit localhost:8000/slides/intro and then click the -> arrow the URL becomes "http://localhost:8000/slides/slides/intro/1"

if I start on http://localhost:8000/slides/intro/1 and hit the <- arrow the URL becomes "http://localhost:8000/slides/intro/slides/intro/0"

I could maybe look into fixing this but im not sure where to start.

Did you ever fix this? Not sure if this is fixed in latest version as I can't use v4 because it breaks with code-surfer (#485).

rohit-gohri avatar Mar 21 '20 09:03 rohit-gohri