HugoBlox / hugo-blox-builder

🚨 GROW YOUR AUDIENCE WITH HUGOBLOX! 🚀 HugoBlox is an easy, fast no-code website builder for researchers, entrepreneurs, data scientists, and developers. Build stunning sites in minutes. 适合研究人员、企业家、数据科学家和开发者的简单快速无代码网站构建器。用拖放功能、可定制模板和内置SEO工具快速创建精美网站!
https://hugoblox.com/templates/
MIT License
8.36k stars 2.9k forks source link

Add `new_tab` option using Hugo's new menu system in v0.79 #2040

Closed gcushen closed 3 years ago

gcushen commented 3 years ago

Feature Request

Add new_tab option using Hugo's new menu system in v0.79 to customize whether main menu links open in new tabs.

Similar logic albeit for a different purpose was proposed in #2010

Other than general customization, such capability would also be useful for those who effectively have a Wowchemy site within a site (e.g. using two templates on the same domain) so that the sites can effectively share the same menu items but when full URLs to the other site instance are provided in the menu, they can open in the same tab.

Requires bumping Hugo min version to 0.79.1.

chrede88 commented 3 years ago

I can take a look at this, but first I need to clarify a few things.

1) new_tab = true forces the link to open in a new tab, i.e. target="_blank" rel="noopener". 2) new_tab = false sets target = "". 3) This will break backwards compatibility, where a http(s) link is automatically opened in a new tab. Or do we want to keep this feature?

chrede88 commented 3 years ago

An immediate problem that comes to mind is that target="_blank" doesn't work with bootstraps data-target. Consequently, specifying new_tab = true on a menu item pointing at a widget, will not open in a new tab.

jonpeake commented 2 years ago

Was this ever implemented? Trying to do something similar in my current menu with external links and a CV file download.

thriveth commented 1 year ago

I would also really like to be able to force a menu item to open in a new tab. Any updates about this feature request?

insanity67 commented 5 months ago

Would be a really nice feature. I have a link to a status page in my menu, this should open in a new tab if possible.