Repository navigation
Regions and the table of contents - #69
Merged
Merged
Conversation
A layout declares regions on page.regions (x-pd-regions) and writes each
as {{{page.regions.<name>}}}, null when empty. A placed component goes
into one by region="..." on its tag or its schema's x-pd-region, in the
page's order; another layout's region is left out, an unknown one stops
the page with a did-you-mean. <body data-pd-regions> names the filled
regions. header, footer, nav and main stay the layout's own landmarks,
and a region's content can't bring one. The table of contents is the
skin's components/toc: toc: true or a layout's x-pd-toc places the
derived one, <pd-toc> places it in the markdown with derived or its own
links, whose anchors must be headings of the page.
… storefront starter
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.
0.5.0 step 6: regions.
page.regions("x-pd-regions": ["sidebar"]) and writes each as{{{page.regions.sidebar}}}, null when the page puts nothing there.<body data-pd-regions="sidebar">names the filled ones, so a skin's grid collapses an empty region without:has().region="sidebar"on thepd-tag, or their schema's"x-pd-region", in the page's order, each still checked against its schema. Another layout's region: left out, no message. A region no layout has: the page stops with a "did you mean".header,footer,nav,mainare the layout's own (one list). A layout declaring one, or a tag or default region naming one, stops the page; a component in a region can't bring a main, banner or contentinfo.components/toc(items: [{ text, href, level }]).toc: true(now a reserved key) or a layout'sx-pd-tocplaces the derived one (headings of level 2 and 3) first in its region;toc: falsekeeps it out.<pd-toc>places it in the markdown, with the derived items or a list of links of its own; its#anchorsmust be headings of the page, checked after the final render (a suffixed anchor counts).toc: true, one with<pd-toc>and custom links, one with neither.Tests: unit (regions, resolution, landmarks, TOC, links), bench E2E in dev and static (the computed grid and boxes at 1000 and 390 px), starter spec. Golden G0 unchanged.