Improve page table of contents navigation - #139
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1551bf8335
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| position: sticky; | ||
| top: 104px; |
There was a problem hiding this comment.
Apply sticky positioning to the full-height column
On desktop pages whose article is taller than the TOC, this element will not remain visible while scrolling. Both updated layouts place .page-toc inside a floated Bootstrap .col-md-3; that column is only as tall as the TOC itself, so the sticky element immediately reaches the bottom constraint of its containing block and behaves like a static element. Apply the sticky positioning to .page-toc-column itself or otherwise stretch that column to the row's article height.
Useful? React with 👍 / 👎.
Motivation
toc: falsedo not render an empty sidebar and that anchored headings are not hidden behind the sticky header.Description
layouts/partials/table-of-contents.htmlthat renders an accessible<aside>with the label “On this page”.layouts/page/single.htmlandlayouts/compliance/list.htmlto use the partial and to check the booleantocvia{{ if .Params.toc }}sotoc: falseis respected.static/css/custom.cssfor the.page-toccomponent that provides card styling, hover/focus states, nested section readability, a sticky desktop position, and scrollable overflow for long TOCs.scroll-margin-toprules so in-page anchor navigation accounts for the site’s sticky header.Testing
python3script with structural assertions to verify both layouts include{{ if .Params.toc }}, the new partial exists, and key CSS selectors are present, and the assertions passed.git diff --checkto validate whitespace/patch issues and it returned clean results.hugo --minify --destination /tmp/misp-publicbuthugois not available in the environment so the site build could not be produced.hugo/browser via the environment package manager but repository/proxy errors prevented those installs, so no visual screenshot/regression was generated locally.Codex Task