dubinc/dub

Allow falling back to secondary (permalink) target when primary target is 404.

RokeJulianLockhart opened this issue · 3 comments

All of my links go to GitLab documents. As https://forum.gitlab.com/t/can-i-explicitly-ask-the-gitlab-web-gui-to-load-the-latest-version-of-a-file-in-the-uri/102524/3?u=rokejulianlockhart explains, because these documents may change, I use a combination of an explicit command to utilize the latest version (the HEAD - the main/master branch) and a fragment directive pointing to the heading so that if that heading changes, the match merely doesn't occur, and the document shall be presented gracefully. An example is https://dub.sh/jga, which links to /blob/HEAD/ with ?plain=0#:~:text=list%2Dstyle%2Dtype:%20none;%20%7D-,Profiles,-Table%20of%20Contents.

However, there have been instances in which the filename of the document has changed. I utilize a path naming convention which is unusually resilient to this, but it still occurs. Consequently, I would like to provide the opposite kind of URI as a fallback - versioned and pointing to specific lines, like /blob/8adbfd946684a3aa6f70b6e55322fdfda96d1eeb/ with ?plain=1#L110-753. (Note that these don't render due to a temporary issue in GitLab, but they work if you remove the fragment directive. Though, it might even be fixed by the time you see this.)

Summarily, I'd like to set a versioned URI as a fallback to my vanity URI.