Open a link in a new tab in the menu I'm using Drupal 8 with Bootstrap theme, and I've created a sub-theme and different menus.

I've tried to edit the menu twig template but i am not really familiar with Twig.

How can I add a menu where links open in new tabs?
In my case I utilized hook_link_alter() to accomplish this.
Situation: in my menu links, I only need Contact Us to open in a new tab.

&lt;?php
function MYMODULE_link_alter(&amp;$variables) {
  if (!$variables['url']-&gt;isRouted()) {
    $uri = $variables['url']-&gt;getUri();
    // Only want the Contact Us to open in new tab.
    if ($uri == 'base:contact-us') {
      $variables['options']['attributes'] = ['target' =&gt; '_blank'];
    }
  }
}