Skip to content

Conversation

@adamdbradley
Copy link
Contributor

  • A layout can either be a filename _layout.tsx or a directory w/ an index _layout/index.tsx
  • A layout (filename or directory name w/ index) can be given a name after a dash, such as _layout-foo.tsx
  • If a page filename includes a @, then after the @ it's specifying which named layout to use. So about-us@foo.tsx would use the first _layout-foo.tsx in the hierarchy rather than _layout.tsx in the same directory.
  • By default all layouts are nested and a page will crawl all the way up to the top of the routes directory to collect a hierarchy of nested layouts for the page.
  • If at any point an applied layout filename ends with ! then it'll stop crawling up the directories and stop nesting at the current hierarchy.

@adamdbradley adamdbradley enabled auto-merge (squash) July 20, 2022 03:49
@adamdbradley adamdbradley merged commit e31f1a9 into QwikDev:main Jul 20, 2022
@adamdbradley adamdbradley deleted the qwik-city-layout branch July 20, 2022 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant