Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External Nav Links Not Showing Without Pages #1020

Closed
OldManUmby opened this issue Oct 29, 2022 · 4 comments · Fixed by #1021
Closed

External Nav Links Not Showing Without Pages #1020

OldManUmby opened this issue Oct 29, 2022 · 4 comments · Fixed by #1021
Labels

Comments

@OldManUmby
Copy link

Describe the bug
External Navigation Links are not showing unless there are regular page links in the navigation first.

To Reproduce
Steps to reproduce the behavior:

  1. Remove all pages except for the index page.
  2. Add an external navigation link.
  3. External link will not show.
  4. Add a regular page, then the external link will show.

Expected behavior
See above.

@OldManUmby OldManUmby added the bug label Oct 29, 2022
@pdmosses
Copy link
Contributor

@OldManUmby Thanks for reporting this bug! It seems that it appears in all the pre-releases of v0.4.0, as well as in the current HEAD (which is what you get by using the unpinned remote_theme: just-the-docs/just-the-docs).

I'll submit a PR to fix the bug, and add a regression test for the fix.

pdmosses added a commit to pdmosses/just-the-docs that referenced this issue Oct 30, 2022
Fix just-the-docs#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 `<ul class="nav-list">…</ul>`.

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.
@pdmosses
Copy link
Contributor

@OldManUmby if you'd like to test the fix in #1021, please try using:

remote_theme: pdmosses/just-the-docs@fix-external-links-without-pages

(If your site is using theme rather than remote_theme, you'll need to add the URL of my fork branch in your Gemfile.)

The regression test for the fix is at https://just-the-docs.github.io/just-the-docs-tests/navigation/external-links/. It's currently marked ❌ to show that it's a bug in v0.4.0.rc3.

@OldManUmby
Copy link
Author

Seem to be working, THX!

mattxwang added a commit that referenced this issue Nov 5, 2022
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 `<ul class="nav-list">…</ul>`.

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 <matt@matthewwang.me>
@mattxwang
Copy link
Member

Hey @OldManUmby - just merged this into main of this branch, so you should be able to use the upstream theme as the remote again. We'll release this fix in v0.4.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants