-
When deploying a private project to GitLab Pages, the
... you end up at something like:
I want to make it easier for folks to share the (shorter) canonical URLs to pages (i.e., In a perfect world, I would imagine said button going right next to the two code actions view/edit buttons but I'm open to anything. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 15 replies
-
Hello @ryran, Once the user authenticates the login and gets redirected to the private link, can they go back to the "public" link and stay there without authentication? From your example I surmise that
is converted to the other one with the same parts + the commit hash:
So if you don't have access to the As for the button next to the code actions, in the Gothic Modding Community we've added a button for translations, you can see the code here (don't mind the comments, they're outdated...), the function is executed in the "DOMContentLoaded" event here, we don't use As for the copy to clipboard logic, I believe this will suffice: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/writeText I guess, another approach to this is to change the link in the URL address bar after the page was loaded. I believe there is a way to change the URL with JavaScript without reloading the page: https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState Also like mentioned in: you can override the |
Beta Was this translation helpful? Give feedback.
Here's the final solution which I'll mark as answer, but it must be made clear that this would never have happened without the help from @kamilkrzyskow so they should get all the credit for this thread. 🙏
overrides/main.html:
docs/javascripts/extra.js: