feat(portal): add title anchors and content page table of contents#86
Draft
BatLeDev wants to merge 1 commit into
Draft
feat(portal): add title anchors and content page table of contents#86BatLeDev wants to merge 1 commit into
BatLeDev wants to merge 1 commit into
Conversation
- title block: optional anchor (slug + table-of-contents label override) - a defined slug makes the title copiable and lists it in the page sommaire - copiable anchor on hover with native title (RGAA) - URL hash set on click and scrolled-to on load (scroll-margin-top = header offset) - sommaire: sticky aside on lg+, collapses to a button + menu otherwise - sommaire hidden on full-width pages, shown only when a title is anchored - long titles wrap instead of being truncated (portals_v1 regression) - buildTocSections/slugifyAnchor utils with unit tests + e2e coverage
d2c2b02 to
59ec325
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add title anchors and a content-page table of contents to the portal.
titleattribute (RGAA); the URL hash is set on click and scrolled to on load (header offset handled viascroll-margin-top)config._toc) is computed server-side from the anchored titles in document order, reusing the shared element traversal so titles nested in columns or catalog blocks are includedWhy: a standing TODO to let a title block carry an anchor and to display a navigable table of contents on content pages.
Heads-up:
layout-page.vueis a shared layout used by many pages — the table of contents renders only when at least one title is anchored, otherwise the layout is unchanged._tocis computed on create/patch only, so existing pages show no table of contents until their next edit + publish (the portal degrades gracefully via_toc ?? []). No backfill migration is included.