Support external navigation links (#876)

Based on #238, resolves #66.
This commit is contained in:
SPGoding
2022-07-13 00:24:54 -05:00
committed by GitHub
parent 6907f06977
commit 009a0f9c5a
7 changed files with 50 additions and 0 deletions

View File

@@ -106,6 +106,11 @@ aux_links_new_tab: false
heading_anchors: true
```
## External navigation links
External links can be added to the navigation through the `nav_external_links` option.
See [Navigation Structure]({{ site.baseurl }}{% link docs/navigation-structure.md %}#external-navigation-links) for more details.
## Footer content
```yaml

View File

@@ -246,6 +246,25 @@ aux_links:
---
## External Navigation Links
To add external links to the navigation, add them to the `nav_external_links` [configuration]({{ site.baseurl }}{% link docs/configuration.md %}) option in your site's `_config.yml` file.
External links will appear under all other items in the listing order.
#### Example
{: .no_toc }
```yaml
# External navigation links
nav_external_links:
- title: Just the Docs on GitHub
url: https://github.com/just-the-docs/just-the-docs
hide_icon: false # set to true to hide the external link icon - defaults to false
```
---
## In-page navigation with Table of Contents
To generate a Table of Contents on your docs pages, you can use the `{:toc}` method from Kramdown, immediately after an `<ol>` in Markdown. This will automatically generate an ordered list of anchor links to various sections of the page based on headings and heading levels. There may be occasions where you're using a heading and you don't want it to show up in the TOC, so to skip a particular heading use the `{: .no_toc }` CSS class.