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

Feature: Allow unlimited multi-level navigation #1431

Open
wants to merge 33 commits into
base: main
Choose a base branch
from

Commits on Feb 24, 2024

  1. Allow unlimited multi-level navigation

    This PR is intended to supersede just-the-docs#462.
    
    The only user-level difference from just-the-docs#462 is that disambiguation of parent pages has to use either `grand_parent` or `ancestor` titles: the somewhat unnatural `section_id` and `in_section` fields are not supported.
    
    The implementation has been significantly simplified by the changes introduced in v0.7.0 of the theme.
    
    This initial draft has not yet been rigorously tested nor profiled.
    pdmosses committed Feb 24, 2024
    Configuration menu
    Copy the full SHA
    c45f622 View commit details
    Browse the repository at this point in the history
  2. Update Gemfile.lock

    pdmosses committed Feb 24, 2024
    Configuration menu
    Copy the full SHA
    4919cb1 View commit details
    Browse the repository at this point in the history
  3. Update Gemfile

    Unclear to me why adding this gem causes CI failures.
    pdmosses committed Feb 24, 2024
    Configuration menu
    Copy the full SHA
    f9db7fd View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7b99d02 View commit details
    Browse the repository at this point in the history
  5. Correct link filename case

    pdmosses committed Feb 24, 2024
    Configuration menu
    Copy the full SHA
    1a02812 View commit details
    Browse the repository at this point in the history

Commits on Feb 25, 2024

  1. Configuration menu
    Copy the full SHA
    9e1fce3 View commit details
    Browse the repository at this point in the history
  2. Remove has_children test

    pdmosses committed Feb 25, 2024
    Configuration menu
    Copy the full SHA
    5c7d2d1 View commit details
    Browse the repository at this point in the history
  3. Add to comment

    pdmosses committed Feb 25, 2024
    Configuration menu
    Copy the full SHA
    8dc6153 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    47a5c79 View commit details
    Browse the repository at this point in the history
  5. Detect cyclic parenthood

    A page should not have a parent or ancestor with the same title. If it does, the location of the repeated link is marked by ∞, to facilitate debugging the navigation (and an unbounded loop leading to a build exception is avoided).
    
    It might be preferable to emit a warning in the Jekyll build log, but that doesn't appear to be supported by Liquid/Jekyll tags.
    pdmosses committed Feb 25, 2024
    Configuration menu
    Copy the full SHA
    655d11a View commit details
    Browse the repository at this point in the history

Commits on Feb 26, 2024

  1. Filter child pages for ancestors

    Reuses `nav_breadcrumbs`.
    pdmosses committed Feb 26, 2024
    Configuration menu
    Copy the full SHA
    25e412e View commit details
    Browse the repository at this point in the history
  2. Avoid Jekyll 4 syntax

    In Jekyll 3, Liquid’s binary `and` and `or` operations cannot be used in the `where_exp` filter...
    pdmosses committed Feb 26, 2024
    Configuration menu
    Copy the full SHA
    6cdc654 View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2024

  1. Adjust generated line breaks

    Avoid diffs from sites built with v0.8.0
    pdmosses committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    5da5c87 View commit details
    Browse the repository at this point in the history
  2. Filter children

    For backward compatibility with 3-level sites
    pdmosses committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    c4f762a View commit details
    Browse the repository at this point in the history
  3. Filter children

    For backward compatibility with 3-level sites
    pdmosses committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    eecba73 View commit details
    Browse the repository at this point in the history
  4. Fix child_nav_order

    pdmosses committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    f50c207 View commit details
    Browse the repository at this point in the history

Commits on Feb 28, 2024

  1. Configuration menu
    Copy the full SHA
    2ee3af5 View commit details
    Browse the repository at this point in the history
  2. Support has_children: false

    This is for backwards compatibility with sites that use `has_children: false` to suppress navigation links to child pages.
    pdmosses committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    a649a47 View commit details
    Browse the repository at this point in the history

Commits on Mar 4, 2024

  1. Fix breadcrumbs for excluded pages

    Takes account of ancestors.
    
    To test, add to 404.html front matter:
    
    ```yaml
    parent: T
    grand_parent: S
    ancestor: Y
    ```
    
    Then check that 404.html has the correct breadcrumbs.
    pdmosses committed Mar 4, 2024
    Configuration menu
    Copy the full SHA
    c31d6e1 View commit details
    Browse the repository at this point in the history

Commits on Mar 9, 2024

  1. Add nav_error_report warning in main navigation

    When activated by `nav_error_report: true` in `_config.yml`, displays warnings about pages with the same title as their parent page or an ancestral page.
    pdmosses committed Mar 9, 2024
    Configuration menu
    Copy the full SHA
    c832248 View commit details
    Browse the repository at this point in the history
  2. Fix breadcrumbs for excluded pages

    The breadcrumbs for excluded pages were incorrect in previous commits, due to interference between assignments in recursive inclusions of ancestry.html.
    pdmosses committed Mar 9, 2024
    Configuration menu
    Copy the full SHA
    9be113b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c825c8b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2b6d919 View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2024

  1. Control flow simplified

    It appears that:
    - `nav_levels[1] == nil` holds only when not `site_nav contains nav_list_link`;
    - `nav_levels[2] == nil and nav_levels[3]` never holds.
    pdmosses committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    6061496 View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2024

  1. Update to multi-level

    * Generate rules for any number of levels
    * Improve layout of generated rules
    * Improve layout of Liquid tags
    pdmosses committed Mar 12, 2024
    Configuration menu
    Copy the full SHA
    ce52b12 View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2024

  1. Optimise breadcrumbs for excluded pages

    Revert to the original code for nav/ancestry.
    
    The previous draft increased the build time 5x with Jekyll 3 for a site with about 550 pages, of which 150 are excluded from the main navigation.
    pdmosses committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    53b47c3 View commit details
    Browse the repository at this point in the history

Commits on Mar 15, 2024

  1. Cache site-nav with links to all pages

    The extra cached site-nav is used for determining breadcrumbs and children navigation, which may involve pages that are excluded from the main navigation.
    
    The inefficient code previously used for excluded pages is now redundant, and to be removed in a subsequent commit.
    pdmosses committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    d3e5290 View commit details
    Browse the repository at this point in the history
  2. Remove redundant code

    pdmosses committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    7deaf18 View commit details
    Browse the repository at this point in the history
  3. Avoid code duplication

    Replace code for determining children by inclusion of components/nav/children.html
    
    Profiling locally, this doesn't appear to lose efficiency.
    pdmosses committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    f454aee View commit details
    Browse the repository at this point in the history

Commits on Mar 17, 2024

  1. Clarify comments

    pdmosses committed Mar 17, 2024
    Configuration menu
    Copy the full SHA
    00b182d View commit details
    Browse the repository at this point in the history
  2. Remove docs changes

    pdmosses committed Mar 17, 2024
    Configuration menu
    Copy the full SHA
    bf2230c View commit details
    Browse the repository at this point in the history
  3. Update Gemfile.lock

    pdmosses committed Mar 17, 2024
    Configuration menu
    Copy the full SHA
    c744937 View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2024

  1. Configuration menu
    Copy the full SHA
    61a97d0 View commit details
    Browse the repository at this point in the history