Hotfix: Fix sidebar truncation warning underflow

Why is this change being made?

Docsy 0.17.0 subtracts the configured sidebar limit from an unsigned page count under Hugo 0.166.0 with YAML configuration. Sections below the limit produce bogus truncation warnings, flooding handbook build logs.

Temporarily override the upstream sidebar template with one arithmetic correction: subtract the number of displayed entries from the available count. Navigation and genuine truncation warnings are preserved. The header links the exact upstream version and removal condition in #53. This fixes CI and local builds through the shared theme, without console filtering or globally silencing warnings.

Validation: python3 scripts/test_sidebar_truncation.py passed using the pinned Hugo Docker image. The test renders the actual sidebar with 2, 3, and 4 entries against a limit of 3, reproduces the original YAML underflow, verifies the corrected warnings and visible links, and checks byte-for-byte HTML equality with the upstream arithmetic. Full theme make compose-build passed: 22 pages, 6.018 seconds Hugo rendering. MR CI provides additional validation; downstream integration builds are still required after the release pin updates.

After merge, publish a patch release and update the internal/public handbook theme pins. Keep #53 open for upstream adoption and eventual override removal.

Author and Reviewer Checklist

Please verify the check list and ensure to tick them off before the MR is merged.

  • Provided a concise title for this Merge Request (MR)
  • Added a description to this MR explaining the reasons for the proposed change, per say why, not just what
    • Copy/paste the Slack conversation to document it for later, or upload screenshots. Verify that no confidential data is added, and the content is SAFE
  • Assign reviewers for this MR to the correct Directly Responsible Individual/s (DRI)
  • For transparency, share this MR with the audience that will be impacted.
    • Team: For changes that affect your direct team, share in your group Slack channel
    • Department: If the update affects your department, share the MR in your department Slack channel
    • Handbook: For changes that affect handbook users, but does not need company-wide attention, post in the #handbook Slack channel
    • Company: If the update affects all (or the majority of) GitLab team members, post an update in #whats-happening-at-gitlab linking to this MR

Edited by Michael Friedrich

Merge request reports

Loading
Loading