Skip to content

Improve page table of contents navigation - #139

Merged
adulau merged 1 commit into
newfrom
codex/improve-table-of-contents-layout
Sep 29, 2026
Merged

adulau merged 1 commit into
newfrom
codex/improve-table-of-contents-layout

Conversation

@adulau

@adulau adulau commented Sep 29, 2026

Copy link
Copy Markdown
Member

Motivation

  • Make the per-page table of contents clearer, more professional, and avoid the cramped/unstyled appearance visible in the screenshots.
  • Reduce duplicated markup by centralizing TOC rendering into a single reusable partial.
  • Ensure pages that set toc: false do not render an empty sidebar and that anchored headings are not hidden behind the sticky header.

Description

  • Add a reusable partial layouts/partials/table-of-contents.html that renders an accessible <aside> with the label “On this page”.
  • Update layouts/page/single.html and layouts/compliance/list.html to use the partial and to check the boolean toc via {{ if .Params.toc }} so toc: false is respected.
  • Add a polished, responsive style block to static/css/custom.css for the .page-toc component that provides card styling, hover/focus states, nested section readability, a sticky desktop position, and scrollable overflow for long TOCs.
  • Add scroll-margin-top rules so in-page anchor navigation accounts for the site’s sticky header.

Testing

  • Ran a small python3 script 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.
  • Ran git diff --check to validate whitespace/patch issues and it returned clean results.
  • Attempted a local Hugo build with hugo --minify --destination /tmp/misp-public but hugo is not available in the environment so the site build could not be produced.
  • Attempted to install hugo/browser via the environment package manager but repository/proxy errors prevented those installs, so no visual screenshot/regression was generated locally.

Codex Task

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T07:49:27.502699Z 1551bf8 PR opened
🔒 Security Review ✅ Completed 2026-09-29T07:49:22.555869Z 1551bf8 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@adulau
adulau merged commit d6efc6b into new Sep 29, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread static/css/custom.css
Comment on lines +515 to +516
position: sticky;
top: 104px;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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 this pull request may close these issues.

1 participant