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

Don't include full dates in blog post URLs #192

Open
huonw opened this issue Apr 16, 2024 · 0 comments
Open

Don't include full dates in blog post URLs #192

huonw opened this issue Apr 16, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@huonw
Copy link
Contributor

huonw commented Apr 16, 2024

Currently our blog post URLs are the default docusaurus paths, e.g. https://www.pantsbuild.org/blog/2024/03/27/pants-2-20

The 2024/03/27 part of that is slightly problematic (e.g. #191):

  • it's in a URL, so we shouldn't change it (or at least, should redirect) if we need to change it
  • a PR might either merge quicker or slower than expected, so whatever date a person chooses when first writing a post is likely to be wrong by the time it merges
  • it's easy to forget to update it to "today" just before merge (e.g. I did this for the post above, Pants 2.20 was released on 2024-04-16 and the post was published then too, not 2024-03-27)

If the date is only metadata displayed to readers, then fixing it after merge is easy and fine... but if it's in the URL, fixing it is hard.

Other options:

  1. no date in URL: https://www.pantsbuild.org/blog/pants-2-20
  2. only year: https://www.pantsbuild.org/blog/2024/pants-2-20
  3. only year/month: https://www.pantsbuild.org/blog/2024/03/pants-2-20

The latter two mean we have some sort of indication of time but a bigger window of validity (i.e. lower chance of making a mistake that's incorrect), but feel somewhat unnecessary.

Based facebook/docusaurus#3284 and what Docusarus itself does (source -> https://docusaurus.io/blog/preparing-your-site-for-docusaurus-v3), I think this unfortunately means remembering to add slug: ... for every single post, so maybe we should have a CI rule that enforces it (plus redirects for old posts).

@huonw huonw added the enhancement New feature or request label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant