carbon-design-system / gatsby-theme-carbon

A Carbon inspired Gatsby theme
https://gatsby.carbondesignsystem.com/
Apache License 2.0
359 stars 274 forks source link

fix: resolves issue with treenav in production #1508

Closed davidmenendez closed 2 months ago

davidmenendez commented 2 months ago

fixes issue where treenav isn't responding correctly to url path in production

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gatsby-theme-carbon ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 10, 2024 8:47pm
netlify[bot] commented 2 months ago

Deploy Preview for gatsby-theme-carbon ready!

Name Link
Latest commit 7ce5cac24d5212340d42540fcf52ba121b987949
Latest deploy log https://app.netlify.com/sites/gatsby-theme-carbon/deploys/66e0a830d8e7fe00082aebf6
Deploy Preview https://deploy-preview-1508--gatsby-theme-carbon.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

szinta commented 2 months ago

@davidmenendez I've identified an issue with this PR, the environment variable process.env.PATH_PREFIX is specific to carbon-for-products-website. This means that the fix will only apply to that website or other websites with a similar configuration for setting the pathPrefix.

I have created another PR with a more generic solution. This fix will work for carbon-for-products-website, but instead of retrieving the pathPrefix from an environment variable, we can use a GraphQL query to fetch it. This will ensure that the fix works for all Gatsby apps, regardless of the environment variable they use to set pathPrefix.

davidmenendez commented 2 months ago

closing in favor of the solution submitted here https://github.com/carbon-design-system/gatsby-theme-carbon/pull/1509