hypra

SEM-010: head in the wrong place

Error: the page doesn't build until this is fixed.

head adds tags to the page's <head>, so it goes directly inside a page, layout or component, not inside another element.

Fails

page(title: "Shoes", description: "All our running shoes, from light racers to trail shoes.") {
  h1 "Shoes"
  section {
    head { link(rel: "stylesheet", href: "/sale.css") }
    p "All our running shoes."
  }
}
error[SEM-010]: `head` belongs directly inside a page, layout or component
 --> page.hypra:4:5
  |
4 |     head { link(rel: "stylesheet", href: "/sale.css") }
  |     ^^^^
  = docs: https://hypralang.dev/rules/sem-010/

1 error, 0 warnings

Fixed

page(title: "Shoes", description: "All our running shoes, from light racers to trail shoes.") {
  h1 "Shoes"
  head { link(rel: "stylesheet", href: "/sale.css") }
  section { p "All our running shoes." }
}