adds option to make aux links open in new tab

This commit is contained in:
Matthew Wang 2019-10-01 22:22:34 -07:00
parent 8bd2da55fe
commit 5549a15df9
3 changed files with 15 additions and 1 deletions

View File

@ -38,6 +38,9 @@ aux_links:
"Just the Docs on GitHub":
- "//github.com/pmarsceill/just-the-docs"
# Makes Aux links open in a new tab. Default is false
aux_links_new_tab: false
# Footer content appears at the bottom of every page's main content
footer_content: "Copyright &copy; 2017-2019 Patrick Marsceill. Distributed by an <a href=\"https://github.com/pmarsceill/just-the-docs/tree/master/LICENSE.txt\">MIT license.</a>"

View File

@ -43,7 +43,15 @@ layout: table_wrappers
{% if site.aux_links != nil %}
<ul class="list-style-none text-small aux-nav">
{% for link in site.aux_links %}
<li class="d-inline-block my-0{% unless forloop.last %} mr-2{% endunless %}"><a href="{{ link.last }}">{{ link.first }}</a></li>
<li class="d-inline-block my-0{% unless forloop.last %} mr-2{% endunless %}">
{% if site.aux_links_new_tab %}
<a href="{{ link.last }}" target="_blank" rel="noopener noreferrer">
{% else %}
<a href="{{ link.last }}">
{% endif %}
{{ link.first }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}

View File

@ -48,6 +48,9 @@ search_tokenizer_separator: /[\s/]+/
aux_links:
"Just the Docs on GitHub":
- "//github.com/pmarsceill/just-the-docs"
# Makes Aux links open in a new tab. Default is false
aux_links_new_tab: false
```
## Heading anchor links