SEO and metadata
Metadata contract
Section titled “Metadata contract”src/layouts/Layout.astro is the canonical metadata wrapper for normal pages.
It accepts optional props:
titledescriptionkeywordsimagecanonicalUrltype(websiteorarticle)
Layout.astro computes defaults and passes normalized values into @cosmos/ui-astro/layout/SeoHead.astro.
Defaults and canonical origin
Section titled “Defaults and canonical origin”- Site defaults are defined in
SITE_CONFIGinsideLayout.astro. siteOriginprecedence:Astro.site?.origin->PUBLIC_SITE_URL-> hardcoded production origin.- If a page does not pass metadata props, layout defaults are used.
Page authoring guidance
Section titled “Page authoring guidance”- Use
Layoutfor public routes unless there is a deliberate exception. - Set explicit
titleanddescriptionfor non-generic pages. - Use
canonicalUrloverride only when a route needs non-default canonical behavior.
Sitemap ownership
Section titled “Sitemap ownership”src/pages/sitemap.xml.tsowns generated XML.- Route entries are explicit in
SITEMAP_ENTRIES; new important routes are not auto-added. lastmodis generated at request time.
Robots ownership
Section titled “Robots ownership”src/pages/robots.txt.tsowns robots output.- It emits a
Sitemap:URL based on Astrositeor environment fallback.
Change checklist
Section titled “Change checklist”- New indexable route: update
SITEMAP_ENTRIESinsitemap.xml.ts. - Canonical/domain change: verify
astro.config.mjssite,PUBLIC_SITE_URL, and layout origin fallback. - Any metadata contract change in shared
SeoHead: verify every page still composes correctly viaLayout.