Programmatic SEO
Programmatic SEO turns your listings into pages. features.pseo and pseo.enabled default to
true; the copy is pseo.templates in site.config.ts, empty in a fresh config.
-
Add an entry to
pseo.templates; theidpicks the pattern.site.config.ts pseo: {enabled: true,maxPages: 2000,templates: [{id: 'best-category-for-tag',enabled: true,minItems: 3,maxItems: 24,title: 'Best {category} {nouns} for {tag} ({year})',description: 'The {count} best {category} {nouns} for {tag}.',h1: 'Best {category} {nouns} for {tag}',intro: 'We compared {count} {nouns}, starting with {topNames}.\n\nEvery {noun} is tagged {tag}.',faq: [{ q: 'How were these picked?', a: 'Reviewed by a human.' }],},],},pnpm check:configanswerssite.config.ts OK — <name> (<url>); …; an unknown placeholder or repeatedidfails, naming the field. -
Build, and read the generator’s lines.
Terminal pnpm buildpseo: generated N (dropped by minItems M, truncated K)seo-report: … pseo N pages (best-category-for-tag=A, name-alternatives=B)Npages,Mcandidates belowminItems,Knon-zero only abovepseo.maxPages. -
Open
https://<your domain>/best-<category>-for-<tag>/, ordist/client/best-<category>-for-<tag>/index.htmlin the build.
-
https://<your domain>/sitemap-pseo-0.xmllists the generated URLs; absent when there are none.
Verify
Section titled “Verify”| Where | You should see | |
|---|---|---|
| The count | build output | pseo: generated N (dropped by minItems M, truncated K), N above 0 |
| A page | /best-<category>-for-<tag>/ |
your h1, intro, one card per listing, the FAQ, “Related guides” |
| The other direction | any listing page | “Appears in”, linking the pages that list it |
| The sitemap | /sitemap-pseo-0.xml |
one <loc> per page |
| Coverage | build output | seo-report: categories without pSEO coverage: none |
Worth knowing
Section titled “Worth knowing”- The ids:
best-category-for-tag→/best-{category}-for-{tag}/,minItems3;name-alternatives→/{name}-alternatives/, 2;free-category→/free-{category}-{nouns}/, 3, off by default. - Two templates making the same slug keep the first; a slug colliding with a reserved segment,
route base, category, tag or listing is dropped as
[zerodirs:pseo] skipped "<slug>". - A
maxItemsabove 24, theItemListceiling, is clamped and reported. - Placeholders are the SEO ones plus
{pricing}and{topNames}— see Registries.introis plain text: a blank line starts a paragraph, no Markdown renders. src/content/pseo/<slug>.mdoverrides one page: its body replaces the intro, itstitleordescriptionthe meta. The FAQ is copy only, noFAQPageschema.
When it is off or degraded
Section titled “When it is off or degraded”| Config state | The visitor sees | Fix |
|---|---|---|
features.pseo: false or pseo.enabled: false |
no pages, no “Appears in”; the report says pseo 0 pages (disabled) |
set both true |
one template enabled: false |
its pages gone, the rest stay | set it true, or delete it |
minItems above the data |
few or no pages; a large dropped by minItems M, and seo-report: categories without pSEO coverage: naming the categories |
lower minItems, or tag more listings |
| the file budget | 80% of the plan limit warns, 90% fails: Cut files (seo.ogScope, fewer pSEO templates, fewer listings) |
fewer templates, seo.ogScope.pseo: false; Cost and limits |
/admin/ reports nothing for any of these.
Configuration
Section titled “Configuration”features.pseo, pseo.enabled, pseo.maxPages, pseo.templates[], seo.templates.pseo and seo.ogScope.pseo — features, pseo, seo. Both switches have to be on; the template list can stay in the file while the feature is off.
Directorysrc/
Directoryfeatures/pseo/
- index.ts
- patterns.ts
- generate.ts
- copy.ts
- templates/PseoPage.astro
Directorycomponents/pseo/
- …
Directorycontent/pseo/
- …
- site.config.ts