The Standard.site schema currently says about publication.url: "Avoid trailing slashes", and about document.path: "Combine with site or publication url to construct a canonical URL to the document. Prepend with a leading slash."
I see two problems with that recommendation:
https://example.comis in fact not a valid fully qualified URL, because thepathalways needs to start with a slash. That's whynew URL("https://example.com").toString()normalizes this correctly tohttps://example.com/. This is a problem if I want my library to accept publication.url as a JSURLobject instead of as a string.- What if my publication's URL is in fact https://mastrojs.github.io/blog/ (with a trailing slash)? Yes, some websites may redirect
/blogto/blog/, but not all will.
That's why I'd advocate for just dropping that recommendation. People should just make sure that publication.url + document.path (string concatenation) resolves to the correct thing.