Cherry.SEO.Head (cherry v0.6.0)

Copy Markdown View Source

Builds the SEO <head> block every page carries: canonical link, feed discovery, icon links (detected from static/Cherry.Site.Icons), meta description, Open Graph / Twitter cards, and JSON-LD BlogPosting for posts.

This is framework-owned HTML handed to the theme's layout as @head_extra — SEO is default-on and a theme cannot forget it.

Summary

Functions

Head block for a content document.

Head block for a synthetic page (blog index, tag pages, 404).

Rungs 2 and 3 of the customization ladder — the tokens: override block and the assets/custom.css link — ride the framework-owned head, so every theme honors them without cooperating. Theme CSS lives in @layer theme; these are unlayered, so they win the cascade no matter where the theme links its stylesheet. custom.css comes after the tokens block: the hand-written escalation beats the config knob.

Functions

for_document(site, doc)

@spec for_document(Cherry.Site.t(), Cherry.Content.Document.t()) :: String.t()

Head block for a content document.

for_page(site, title, path)

@spec for_page(Cherry.Site.t(), String.t(), String.t()) :: String.t()

Head block for a synthetic page (blog index, tag pages, 404).

styling(site)

@spec styling(Cherry.Site.t()) :: String.t()

Rungs 2 and 3 of the customization ladder — the tokens: override block and the assets/custom.css link — ride the framework-owned head, so every theme honors them without cooperating. Theme CSS lives in @layer theme; these are unlayered, so they win the cascade no matter where the theme links its stylesheet. custom.css comes after the tokens block: the hand-written escalation beats the config knob.

Part of common/4; public for the pages that carry no SEO head (404).