How caglayanevren/astro-notion-netlify works
This is an Astro-powered Notion blog. Its main content workflow loads published Notion pages into Astro’s blog collection, adapts and renders them for blog pages, and uses a separate image-sync process to prepare cover assets and a manifest. An update API can trigger a Netlify deploy hook. Sampled files support the loader, content adapter, image cache, and update endpoint; page templates and layout are present in the tree but were not sampled, so their runtime connections are not asserted.
Main entry points: sync-notion-images.mjs Image sync process · notion.ts Post data adapter · content.config.ts Blog collection · astronotionloaderpatch.ts Notion loader patch
Components 18
Content and rendering
- Blog collection
src/content.config.ts - Notion loader patch
src/utils/astronotionloaderpatch.ts - Post data adapter
src/utils/notion.ts - Post data types
src/config.ts - Blog detail route
src/pages/blog/[slug].astro - Home route
src/pages/index.astro - Site layout
src/layouts/Layout.astro - Image wrapper
src/components/misc/ImageWrapper.astro - Image wrapper copy
src/components/misc/ImageWrapper-copy.astro
Notion image assets
- Image sync process
scripts/sync-notion-images.mjs - Generated image assets
src/assets/notion-generated - Netlify Blob cache
- Image manifest types
src/types/notion-image-manifest.d.ts
Deployment operations
- Update endpoint
src/pages/api/update.ts
Other components
- Site visitor
- Astro content layer
- Notion API
- Netlify deploy hook
Connections 14
- Site visitor → Blog detail route: requests page
- Site visitor → Home route: requests page
- Astro content layer → Blog collection: loads collection
src/content.config.ts - Blog collection → Notion loader patch: configures loader
src/content.config.ts - Notion loader patch → Astro content layer: wraps loader
src/utils/astronotionloaderpatch.ts - Post data adapter → Astro content layer: reads collection
src/utils/notion.ts - Post data adapter → Post data types: uses types
src/utils/notion.ts - Image sync process → Notion API: queries pages
scripts/sync-notion-images.mjs - Image sync process → Notion API: retrieves images
scripts/sync-notion-images.mjs - Image sync process → Netlify Blob cache: reads and writes
scripts/sync-notion-images.mjs - Image sync process → Generated image assets: writes assets
scripts/sync-notion-images.mjs - Post data adapter → Generated image assets: resolves cover paths
src/utils/notion.ts - Site visitor → Update endpoint: requests update
- Update endpoint → Netlify deploy hook: triggers deploy
src/pages/api/update.ts