Display main menu item based on the URL
Yeah, I think your guess is good.


Create a block programmatically: Create a custom Block. This means to create an own module with this block.
The created block should appear (when the module is activated) in your block settings, there you can add it.
The content of your block appears where you added it.


Another option, easier but not so beautiful, could be to hook in your THEME.theme. As an example you can add the menu in the  template_preprocess_html:

function template_preprocess_html(&amp;$variables) {
    $variables['my_own_menu'] = $my_own_menu;
}


Then you can use the variable {{ my_own_menu }} in your html.html.twig and do whatever you want to do.