-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External links in new tab/window #505
Comments
that should always be a user decision from my point of view. I don’t like sites who spawn off in different tabs or windows. |
I came up with the same solution when I was searching for a way to put an external link to a main.menu item on my web site config.toml. All the links are now opens in a new tab but still could not find a solution for this one. External link in the main menu used to work in the previous version of Coder or Hugo. I recently upgraded to the latest version of Coder and using hugo version 0.80.0 and this set up sends me to this link: https://www.naimcinar.com/https:/naimcinar.myportfolio.com/ instead.
|
I totally agree with @a1x42. But, it seems Hugo is not recognizing your URL as an absolute one. Let me check if we are doing something wrong in this theme template or if this is really a Hugo bug, |
Absolute URLs are working perfectly. |
I have been just down this rabbit hole trying to find a solution, while I agree with @a1x42 conceptually there are times where websites may have a need to send you to a different website in the menu and maintain the existing window. And shockingly not all end users actually know how to accomplish this. Is it not possible to have this as an option on the config.toml for specific menu items. It seems some other themes support this. I am super new to Hugo in general so be kind if I'm saying something stupid. |
It is possible, and it is straightforward to add a |
I followed this guide and still url not opening in new tab. |
I also followed the guide that @solomonrajan used. No luck for me; it is still opening my URL in the current window. @rshorser have you had any luck with your attempted fix? |
Here is a workaround to open links with a different base URL in a new tab:
I created a modified |
Is there an existing way to configure external links to open in a new tab/window?
From some quick googling, looks like one would have to add a hook to enable this.
Happy to open a PR if no existing solution exists yet
The text was updated successfully, but these errors were encountered: