Closed RokeJulianLockhart closed 3 weeks ago
This might be a bit tricky to implement in an on-demand fashion since we'll need to first make a request to see if the URL returns a 404 status code, and then fallback to the backup URL.
An alternative is to incorporate this as part of #417 (WIP) where we notify you when a URL 404s. Will close this issue for now in favor of that PR!
https://github.com/dubinc/dub/issues/1059#issuecomment-2282362208
@steven-tey, that's a great feature, but it's not of much use to me. The reason I want this is that when I do training exercises, or am deployed somewhere, I can't respond to a URI going down. I don't believe that these should be mutually exclusive.
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
- themain
/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.