LAYOUT-002: layout has no slot
Error: the page doesn't build until this is fixed.
A layout is the frame around a page, and slot is where the page goes. Without it, the page's content
would disappear, which is why the example also loses its h1.
Fails
layout Shop {
header { a("/") "Shop" }
footer { p "Free returns within 30 days." }
}
page(title: "Shoes", description: "All our running shoes, from light racers to trail shoes.", layout: Shop) {
h1 "Shoes"
}error[LAYOUT-002]: layout has no `slot`, so page content would disappear
--> page.hypra:1:1
|
1 | layout Shop {
| ^^^^^^
= help: put `slot` where the page content goes, e.g. main { slot }
= docs: https://hypralang.dev/rules/layout-002/
warning[SEO-004]: page has no h1
--> page.hypra:6:1
|
6 | page(title: "Shoes", description: "All our running shoes, from light racers to trail shoes.", layout: Shop) {
| ^^^^
= help: add h1 "..." with the page's main topic
= docs: https://hypralang.dev/rules/seo-004/
1 error, 1 warningFixed
layout Shop {
header { a("/") "Shop" }
main { slot }
footer { p "Free returns within 30 days." }
}
page(title: "Shoes", description: "All our running shoes, from light racers to trail shoes.", layout: Shop) {
h1 "Shoes"
}