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

Include unique ID that doesn't change in slug #139

Open
sidemt opened this issue Sep 5, 2023 · 5 comments
Open

Include unique ID that doesn't change in slug #139

sidemt opened this issue Sep 5, 2023 · 5 comments

Comments

@sidemt
Copy link
Member

sidemt commented Sep 5, 2023

This is more of a need for the 11ty and front-end apps.

We would want to design the slug such that it always contains a unique ID in the following format:

https://freecodecamp.org/news/my-awesome-article-12ab4c56

where the 12ab4c56 is an 8-char hexadecimal unique id.

For inspiration, the forum URLs look like so:

  • https://forum.freecodecamp.org/t/announcement-hacktoberfest-2023-contribute-to-freecodecamp/641747
  • https://forum.freecodecamp.org/t/announcement-hacktoberfest-2023/641747
  • https://forum.freecodecamp.org/t/announcement/641747
  • https://forum.freecodecamp.org/t/announcement2023-contribute-to/641747

These all lead to https://forum.freecodecamp.org/t/641747

Because the forum software (discourse) ignores the slug and uses the topic number.

@sidemt sidemt changed the title Unique slug that doesn't change Include unique ID that doesn't change in slug Oct 11, 2023
@sidemt
Copy link
Member Author

sidemt commented Oct 11, 2023

@raisedadead Do we want it to be
https://freecodecamp.org/news/my-awesome-article-12ab4c56
or
https://freecodecamp.org/news/my-awesome-article/12ab4c56?

- or / for separating my-awesome-article and 12ab4c56

@raisedadead
Copy link
Member

I prefer the former format with the -. The / are a pain to handle as is.

@sidemt
Copy link
Member Author

sidemt commented Oct 11, 2023

OK, thank you for confirming.

@sidemt
Copy link
Member Author

sidemt commented Oct 11, 2023

(Note) Reasons behind this:

  • We don’t want to expose the default ID for extra safety
  • We don’t want to set redirect every time user changes the slug of the published articles
  • We can switch to other backend system if we need to in the future

@sidemt
Copy link
Member Author

sidemt commented Oct 31, 2023

(Meeting notes) We don't need slug-id for other models such as users or tags.
The main purpose of adding it is to make URLs available even after changing the slug. It's less likely authors change their username frequently.

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

No branches or pull requests

2 participants