feat: manage press kit download via payload

This commit is contained in:
syntaxbullet
2026-06-22 13:11:35 +02:00
parent c5feeaee16
commit e21e2f1210
5 changed files with 17 additions and 3 deletions

View File

@@ -32,10 +32,11 @@ async function main() {
const page = pageResult.docs[0]
if (!page) throw new Error('Press index page not found. Expected spaPath=/presse or slug=presse/press.')
const [heroImage, eventFallbackImage, newsFallbackImage] = await Promise.all([
const [heroImage, eventFallbackImage, newsFallbackImage, kitFile] = await Promise.all([
mediaByFilename(payload, pressIndexContent.hero.imageFilename),
mediaByFilename(payload, pressIndexContent.events.collectionFallbackImageFilename),
mediaByFilename(payload, pressIndexContent.news.collectionFallbackImageFilename),
mediaByFilename(payload, pressIndexContent.downloads.kitDownloadName),
])
const { imageFilename: _heroFilename, ...heroContent } = pressIndexContent.hero
const { collectionFallbackImageFilename: _eventFallbackFilename, ...eventsContent } = pressIndexContent.events
@@ -61,6 +62,10 @@ async function main() {
...newsContent,
collectionFallbackImage: newsFallbackImage,
},
downloads: {
...pressIndexContent.downloads,
kitFile,
},
},
} as never,
})