Skip to content

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

Open
@huonw

Description

@huonw

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).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions