mirror of
https://github.com/Afilmory/afilmory
synced 2026-02-01 22:48:17 +00:00
Fix: photo data parsing to access 'data' property from JSON manifest (#17)
This commit is contained in:
@@ -39,8 +39,8 @@ export function createFeedSitemapPlugin(siteConfig: SiteConfig): Plugin {
|
||||
__dirname,
|
||||
'../../packages/data/src/photos-manifest.json',
|
||||
)
|
||||
const photosData: PhotoData[] = JSON.parse(
|
||||
readFileSync(manifestPath, 'utf-8'),
|
||||
const photosData: PhotoData[] = (JSON.parse(
|
||||
readFileSync(manifestPath, 'utf-8'),).data
|
||||
)
|
||||
|
||||
// Sort photos by date taken (newest first)
|
||||
|
||||
@@ -30,7 +30,7 @@ class BuildTimePhotoLoader {
|
||||
try {
|
||||
const manifestPath = join(workdir, 'src/data/photos-manifest.json')
|
||||
const manifestContent = readFileSync(manifestPath, 'utf-8')
|
||||
this.photos = JSON.parse(manifestContent) as PhotoManifest[]
|
||||
this.photos = JSON.parse(manifestContent).data as PhotoManifest[]
|
||||
|
||||
this.photos.forEach((photo) => {
|
||||
this.photoMap[photo.id] = photo
|
||||
|
||||
Reference in New Issue
Block a user