Fully Automatic Homepage
The homepage uses a data file called:
src/_data/homeCollections.js
This script:
- Scans the
src/folder - Finds all top-level collections which have a matching
.njkfile - Tries to read each collection’s image from its JSON file
- Builds the homepage cards automatically
Example
If you create:
- a new folder
src/photography/ - a template file
src/photography.njk - a JSON file
src/photography/photography.jsonwith animagefield
then a new card for “Photography” will appear on the homepage automatically. No changes to the homepage template or the Eleventy config are needed.