1

So, let's take, for example, the following sentence:

Chandra Source Catalog Release 2.0

I've run this through various string.to_slug() and sluggify(string) methods on different platforms and systems. The outcome is always the following:

chandra-source-catalog-release-20

Which to me seems incorrect. How should the above edge case be handled? Preference would be for the following:

chandra-source-catalog-release-2_0

It feels like it has an obvious answer, but then, nuance. The other time a full stop appears is at the end of a sentence. So, we could have:

Chandra Source Catalog Release 2.0.

I guess what I am asking is as well, is what is the best practice for handling such version numbers in URL slugs?

Micheal J. Roberts
  • 3,735
  • 4
  • 37
  • 76

1 Answers1

0

The best way that I have seen for slugging version numbers, is to keep the . there are some outliers, that don't follow this but many of the largest companies will keep the .. To stay consistent with other websites I would keep the ..

For example, if you look at the newest version of this library:

https://github.com/rawleyfowler/sluj/releases/tag/1.0.2

You'll notice github keeps the . between version numbers.

https://gitlab.com/gitlab-org/gitlab/-/releases/v15.2.0-ee

Gitlab also does this.

Since . falls within the unreserved category of RFC3986 it is okay to keep the . in the version numbers for your URI.

Rawley Fowler
  • 1,366
  • 7
  • 15