Content apart from components
Typed collections turn editing a heading into editing text rather than code.
When a page heading lives in a component’s markup, it stops being content: it cannot be edited without a developer, and it is not checked by the schema.
What a collection gives
- A schema. The
descriptionfield is limited in length,slugis validated against a format,dateis coerced to a date. - Reuse. A section takes an object and does not know where it came from: from a collection or from a manual call on the home page.
- A single source. The same heading is not duplicated in three components.
Drafts
The draft field excludes an entry from the build. That is convenient: material can be prepared
gradually, without showing it to visitors and without adding it to the sitemap.
A practical rule
If the text is changed by someone other than a developer, it lives in the content. Everything else can stay in the code.
- content
- architecture