hypra

SEO-005: canonical URL isn't absolute

Warning: the page still builds, but this is most likely a mistake.

The canonical URL tells search engines which address is the real one when a page has several, like with ?ref= or ?sort=. They only follow a full URL with https:// and the domain.

Fails

page(title: "Shoes", description: "All our running shoes, from light racers to trail shoes.", canonical: "/shoes") {
  h1 "Shoes"

}
warning[SEO-005]: canonical URL isn't absolute
 --> page.hypra:1:106
  |
1 | page(title: "Shoes", description: "All our running shoes, from light racers to trail shoes.", canonical: "/shoes") {
  |                                                                                                          ^^^^^^^^
  = help: search engines need the full URL, e.g. canonical: "https://example.com/page"
  = docs: https://hypralang.dev/rules/seo-005/

0 errors, 1 warning

Fixed

page(title: "Shoes", description: "All our running shoes, from light racers to trail shoes.", canonical: "https://shop.example.com/shoes") {
  h1 "Shoes"

}