From 29b5d147896a5156d826fcb2b01799b7fc27d4f5 Mon Sep 17 00:00:00 2001
From: Peter Mosses <18308236+pdmosses@users.noreply.github.com>
Date: Sat, 5 Nov 2022 08:35:37 +0100
Subject: [PATCH] Fix external links for sites with no pages (#1021)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fix #1020
- Move the display of nav external links from `_includes/nav.html` to `_layouts/default.html`.
- Replace ` unless include.key` by `if site.nav_external_links`.
- Wrap the body of `if site.nav_external_links` in `
…
`.
To test this PR:
1. Add to `_config.yml`:
```yaml
defaults:
-
scope: {path: ""}
values: {nav_exclude: true}
```
2. Check that the only link to appear in the nav panel is external.
Co-authored-by: Matt Wang
---
_includes/nav.html | 11 -----------
_layouts/default.html | 12 ++++++++++++
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/_includes/nav.html b/_includes/nav.html
index 305ac71..994a4b2 100644
--- a/_includes/nav.html
+++ b/_includes/nav.html
@@ -207,17 +207,6 @@
{%- endunless -%}
{%- endfor -%}
-{%- unless include.key -%}
- {%- assign nav_external_links = site.nav_external_links -%}
- {%- for node in nav_external_links -%}
-