Add configuration options for opening external links in new tab (#1360)

I've whipped up a solution that solves #1103. I've added a config option `nav_external_links_new_tab`, which is off by default. When turned on, it'll pop external nav links into a new tab. The idea was borrowed from how [aux_nav.html](https://github.com/just-the-docs/just-the-docs/blob/main/_includes/components/aux_nav.html) does it with `aux_links_new_tab`.

---------

Co-authored-by: Matt Wang <matt@matthewwang.me>
This commit is contained in:
CarbonNeuron
2023-10-04 14:10:56 -05:00
committed by GitHub
parent 2ccc451c2a
commit 33ba8d8eaa
4 changed files with 28 additions and 5 deletions

View File

@@ -4,7 +4,7 @@
Results in: HTML for the side bar.
Includes:
title.html, components/site_nav.html, nav_footer_custom.html
Overwrites:
Overwrites:
nav_footer_custom.
Should not be cached, because nav_footer_custom.html might depend on page.
{%- endcomment -%}
@@ -16,9 +16,9 @@
<svg viewBox="0 0 24 24" class="icon" aria-hidden="true"><use xlink:href="#svg-menu"></use></svg>
</button>
</div>
{% include_cached components/site_nav.html %}
{% capture nav_footer_custom %}
{%- include nav_footer_custom.html -%}
{% endcapture %}