Skip to main content

Module content_checks

Module content_checks 

Source
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§

ContentCheckRegistration
Inventory registration — mirrors crate::admin::report / crate::admin::model_admin.
EmptySeoDescriptionCheck
Empty meta description (SEO check). A page with no seo_description lets 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::Violation but carries a category so the panel can group SEO / content / custom checks.
MissingOgImageCheck
Missing social share image — no og:image, so link unfurls on social / chat have no preview image. Info.
ThinSeoDescriptionCheck
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§

ContentCheck
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 code for 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.