From 009a0f9c5a236fb5d6a2708928a909fd122d3fe0 Mon Sep 17 00:00:00 2001 From: SPGoding Date: Wed, 13 Jul 2022 00:24:54 -0500 Subject: [PATCH] Support external navigation links (#876) Based on #238, resolves #66. --- _config.yml | 5 +++++ _includes/icons/external_link.html | 5 +++++ _includes/nav.html | 9 +++++++++ _layouts/default.html | 1 + _sass/navigation.scss | 6 ++++++ docs/configuration.md | 5 +++++ docs/navigation-structure.md | 19 +++++++++++++++++++ 7 files changed, 50 insertions(+) create mode 100644 _includes/icons/external_link.html diff --git a/_config.yml b/_config.yml index b0f9310..5944d04 100644 --- a/_config.yml +++ b/_config.yml @@ -87,6 +87,11 @@ aux_links_new_tab: false # nav_sort: case_insensitive # default, equivalent to nil nav_sort: case_sensitive # Capital letters sorted before lowercase +# External navigation links +nav_external_links: + - title: Just the Docs on GitHub + url: https://github.com/just-the-docs/just-the-docs + # Footer content # appears at the bottom of every page's main content diff --git a/_includes/icons/external_link.html b/_includes/icons/external_link.html new file mode 100644 index 0000000..1592be6 --- /dev/null +++ b/_includes/icons/external_link.html @@ -0,0 +1,5 @@ + + + (external link) + + diff --git a/_includes/nav.html b/_includes/nav.html index a2aa2d6..3881008 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -104,6 +104,15 @@ {%- endunless -%} {%- endif -%} {%- endfor -%} + {%- assign nav_external_links = site.nav_external_links -%} + {%- for node in nav_external_links -%} + + {%- endfor -%} {%- if page.collection == include.key -%} diff --git a/_layouts/default.html b/_layouts/default.html index 63e23b0..a09a2a4 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -38,6 +38,7 @@ layout: table_wrappers + {% include icons/external_link.html %}