Expand description
Extensible content-checks framework.
The accessibility panel (crate::a11y) runs a fixed set of
server-side heuristics. This module generalises that idea into a
registerable check framework:
a host implements ContentCheck, registers it with
register_content_check!, and its findings show up in the editor’s
“Content & SEO” panel alongside the built-ins.
Ships built-in SEO checks — most notably the empty meta-description check — plus a thin / missing social-image heuristic.
Checks are synchronous and run against the saved Page (the panel
is server-rendered on editor open, same as the a11y heuristics). The
Severity levels are shared with the a11y
panel so the two read consistently.
Structs§
- Content
Check Registration - Inventory registration — mirrors
crate::admin::report/crate::admin::model_admin. - Empty
SeoDescription Check - Empty meta description (SEO check). A page with no
seo_descriptionlets the search engine synthesise a snippet from the body — usually worse than an authored one. Warning (it’s recommended, not required). - Finding
- One content/SEO finding surfaced to the editor. Mirrors
crate::a11y::Violationbut carries acategoryso the panel can group SEO / content / custom checks. - Missing
OgImage Check - Missing social share image — no
og:image, so link unfurls on social / chat have no preview image. Info. - Thin
SeoDescription Check - Thin meta description — present but very short, so it under-uses the SERP snippet. Info (a nudge, not a problem). Skipped when the description is empty (the empty check already fired).
Traits§
- Content
Check - A registerable content check. Implementors are zero-field structs
registered with
register_content_check!.
Functions§
- count_
by_ severity - Counts grouped by severity — drives the panel badge.
- registered_
checks - Every registered content check, sorted by
codefor a stable order. - run_all
- Run every registered check against
page, returning a stable-sorted list (errors first, then warnings, then info; ties keep registry order). Drives the editor’s “Content & SEO” panel.