Giter VIP home page Giter VIP logo

Comments (4)

kgodsmark avatar kgodsmark commented on July 24, 2024 6

I've fixed it, but I daresay it's a hacked solution.

I did 2 things.

  1. In src/components/LocalizedLink.js, I applied a starting slash to the Link path only when not using the default lang. This stops the multiple layers of e.g./pt/blog/pt/contato:
const path = locales[locale].default
    ? to
    : `/${locales[locale].path}${isIndex ? `` : `${to}`}`;
return <Link {...props} to={path} />;
  1. In src/components/Languages/index.js, I stopped the double slash bug when switching from EN version:
const singleSlashSlug = associatedUrls[lang].replace(/\/\//g,'/');
    return lang === "en" ?
      navigate(singleSlashSlug) :
      navigate(`/${lang}${singleSlashSlug}`);

I'm not 100% sure this solution is worth a PR as there could be a different reason for why the path started with this odd behaviour. It'd be useful to know if this is a recent issue. And to know if the code currently published on netlify https://iceberg-gatsby-multilang.netlify.app/ is that from master.

Let me know what you think @diogorodrigues @iplanwebsites.

from iceberg-gatsby-multilang.

kgodsmark avatar kgodsmark commented on July 24, 2024

This is happening to me too. Maybe it's something that has only recently surfaced. It'd be great to hear if anyone has fixed it or hasn't had this problem.

from iceberg-gatsby-multilang.

rfoel avatar rfoel commented on July 24, 2024

I started deleting things around that I think I won't use and this bug happened.

from iceberg-gatsby-multilang.

rfoel avatar rfoel commented on July 24, 2024

I found out that removing the netlify plugin causes this bug, don't ask me why. The reason I'm deleting it is because I will deploy somewhere else and I won't use netlify cms.

from iceberg-gatsby-multilang.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.