tldr-pages / tldr-lint

A linting tool to validate tldr pages
https://www.npmjs.com/package/tldr-lint
MIT License
35 stars 20 forks source link

New linter error if the more information URL ends in '/' #290

Closed gutjuri closed 7 months ago

gutjuri commented 7 months ago

Afaik we discourage this. We could also add this to our style-guide.

kbdharun commented 7 months ago

We discussed this some time ago (I don't remember where). @SethFalco mentioned the issue with this, i.e. trailing / is required in the URL to show the actual page. Without it, they might show a completely different page or an error page. Which would ultimately, lead us to exclude the error code from the CI.

SethFalco commented 7 months ago

For a base domain, like example.org/ vs example.org, it makes no difference, so we can do whatever.

For a domain with a path on it, like example.org/foo/ vs example.org/foo, these are entirely different URLs and different web servers may route them differently. Most just happen to redirect one to the other.

Assuming no normalization is taking place, /example and /example/ are different paths.

From a technical, search engine standpoint, it's certainly permissible for these two URL versions to contain different content.

https://developers.google.com/search/blog/2010/04/to-slash-or-not-to-slash

https://matrix.to/#/%23tldr-pages%3Amatrix.org/%24p4cGxZ9fwKkmMfNux8c6m9I_xPEXZdIYq3IgAG8G8Zs?via=one.ems.host&via=gitter.im&via=matrix.org&via=yatrix.org

We could apply a rule to base domains, but if we were to have a rule for paths, I'd favor whatever doesn't cause a redirect rather than whatever has a prettier URL.

gutjuri commented 7 months ago

Ok makes sense, thanks!