Giter Site home page Giter Site logo

Comments (13)

scissorsneedfoodtoo avatar scissorsneedfoodtoo commented on August 17, 2024 1

I'm going to go ahead and close this issue since it's so unlikely that others will run into it. Also, I've since reinstalled my OS without encryption and this issue no longer affects me.

Just in case someone does have the same problem in the future, the workaround I used was to change these lines:

learn/gatsby-node.js

Lines 14 to 16 in 2f3c21c

const slug = `/${dasherize(superBlock)}/${dasherize(block)}/${dasherize(
title
)}`;

to the following:

    const slug = `/${dasherize(block)}/${dasherize(
      title
    )}`;

Then running yarn develop passes. The only problem seems to be that certain pages like the intro to each section don't work. All the challenges load, though.

from learn.

Bouncey avatar Bouncey commented on August 17, 2024

Oh thats weird... those files are generated and used by gatsby. Perhaps @KyleAMathews could help? Maybe something to search for in the gatsbyjs/gatsby repo.

from learn.

scissorsneedfoodtoo avatar scissorsneedfoodtoo commented on August 17, 2024

Okay! Thanks for the quick response. I'll take a look around the gatsby repo to see if there were any other people with similar issues.

from learn.

Bouncey avatar Bouncey commented on August 17, 2024

Did you find a solution @scissorsneedfoodtoo?

from learn.

scissorsneedfoodtoo avatar scissorsneedfoodtoo commented on August 17, 2024

Yes, I was able to find a solution, but unfortunately it means shortening the slug by removing the superBlock from each, leaving them with just the block and title. However this would mean the URL for each page is more in line with beta. For example, beta is now:

https://beta.freecodecamp.org/en/challenges/css-grid/create-your-first-css-grid

Currently Learn is:

https://learn.freecodecamp.org/responsive-web-design/css-grid/create-your-first-css-grid

And by removing the superBlock would be:

https://learn.freecodecamp.org/css-grid/create-your-first-css-grid

We could always shorten the titles of the three challenges causing the error, too, but that doesn't seem ideal. Let me know what you think! In the meantime I'll keep looking around the gatsby repo to see if there's another solution.

from learn.

Bouncey avatar Bouncey commented on August 17, 2024

@scissorsneedfoodtoo thanks for confirming the issue. We should raise this in the gatsby repo so they can look at potential work-arounds, seeing as they are generated and used by gatsby itself.

There are a couple of reasons the url slug has changed from production/beta -> learn

  • /challenges/ has been dropped as the learn subdomain is solely for the challenges/lessons provided by freeCodeCamp. We are not hosting any account or meta specific pages (/about, /settings etc...) on the learn subdomain, so the differentiation is not required.
  • /superBlock/block/challenge was selected to improve SEO. We are adding pages at both the /superBlock and /superBlock/block levels which will index the content for that block/superBlock. For example, someone searching to learn about microservices will hopefully land on the /apis-and-microservices route and see a list of all the blocks taught in that section, instead of landing on a random challenge potentially halfway through or at the end of a block.

I hope this clears up why things have changed in this respect 😁

from learn.

scissorsneedfoodtoo avatar scissorsneedfoodtoo commented on August 17, 2024

@Bouncey, thank you for the explanation! That does certainly clear things up about the changes to the url slug. I especially like the idea of improved SEO and users hopefully being shown a list of all the blocks rather than being thrown into the thick of things.

There was a similar issue that I found in the gatsby repo, similarly encrypted Linux system, too. I'll comment there and see about a work-around.

from learn.

Bouncey avatar Bouncey commented on August 17, 2024

@scissorsneedfoodtoo nice find! Could you link to it from here please so we can track it 👍

from learn.

scissorsneedfoodtoo avatar scissorsneedfoodtoo commented on August 17, 2024

Sure! It's issue #4125 in the gatsby repo. I'll write a comment about the issue here a little later today.

from learn.

Bouncey avatar Bouncey commented on August 17, 2024

@scissorsneedfoodtoo Would you like to rename the challenges so that they allow contributors like you to work locally?

from learn.

scissorsneedfoodtoo avatar scissorsneedfoodtoo commented on August 17, 2024

@Bouncey, I think it's okay for now. @tchaffee and I are probably in the minority, and it's not a problem to edit the challenge names to work locally. Maybe if a lot of other users run into the same issue we can rename those challenges.

Just to keep you posted about what's going on in the open issue in the Gatsby repo, @KyleAMathews suggested and algorithm to do the following:

  1. Naively create the original filename
  2. Create a hash the original file name
  3. remove common words e.g. and, an, or, etc. I'm sure there's an NPM package for this,
  4. Append the hash to the shortened file name
  5. if the file name is too long still, split the name at dashes and remove words until the name + hash is < MAX_FILE_NAME_LENGTH

Thought about offering to help implement the method above, but didn't want to mess with the SEO here.

from learn.

mstellaluna avatar mstellaluna commented on August 17, 2024

I am running Windows 10 Pro 64-bit, if you need me to try anything on windows, let me know.

from learn.

tchaffee avatar tchaffee commented on August 17, 2024

In case it helps someone, my workaround was to move the repo out of my home directory.

from learn.

Related Issues (20)

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.