to-be broken links
I just stumbled multiple times upon broken links that should've been working, which prompted me to write this.
On the internet, websites go down. Pages are deleted. Content is edited. As a result links go stale, but it sometimes happens way sooner than it should.
Things are under constant change, which is why links should be made as resilient as possible. This is not always the case.
Links to content that can (and so will) change can easily be given a longer lifespan. Documentation and files belong to this category of content.
Let's start with anchor links. They're amazing for pointing people directly to a certain part of a page, but they're awful when they stop pointing to what they once did and end up being more confusing than helpful.
Maybe the worst is when linking to an anchor that doesn't have a clear name (let's say id3
, as in https://tomifont.com/to-be-broken-links#id3, and doing so without giving enough context for the readers to find their way when the link doesn't point to what it originally did anymore.
This easily happens as sections of a page are added, deleted, or rearranged. These unclear anchor links shouldn't exist in the first place, but when they do and there is no better option to save you, a helpful thing is to quote the relevant part that you are linking to. This will help no matter what happens to the anchor link. This is exactly what I did with my anchor links
link.
Speaking of which, it could actually be made more resilient than that. Right now, it points to the current revision of the Wikipedia article on hyperlinks. But how about if the article gets renamed? Or removed altogether? Not to even mention the more usual case of the relevant part I am linking to getting edited or removed from the article.
All of this can actually be avoided by linking to a version that is guaranteed not to change. By linking to a specific revision, we protect ourselves against the passage of time. Granted, of course, that the website supports this now and in the future, which, if it's well-established, I wouldn't worry too much about.
Luckily for us, Wikipedia has just this. On any page, we can click on View history
, which lets us grab permalinks to any version of the page. This way, it's guaranteed that the content we are linking to will remain the same in the future. So, for our beloved anchor links
link, this gives this (or that). Not quite as short and simple as the original link, but links can be camouflaged anyway.
The same applies to different manifestations of the same concept:
- Documentation for which multiple versions are available. Avoid linking to the
current
version of the documentation. Instead, take the version that is the latest at the time of linking, and make sure that the link sticks with it. - Version-controlled files. Links to them are bound to rot especially fast as projects evolve, files are edited, and folders reorganized. Again, prefer taking a version frozen in time. In Git terms, this means pointing to a particular commit hash or, for shorter links, a tag that is guaranteed to remain unchanged.
Let's try to be more mindful of the links we share for a better-connected internet. ♡
Comments ()