Skip to content

Commit 2df771b

Browse files
committed
Fix sitemap invalid path
1 parent a3fd59c commit 2df771b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/app/sitemap.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,17 @@ async function sitemap(): Promise<MetadataRoute.Sitemap> {
110110
projects?.docs.forEach((project) => {
111111
const path = `projects/${project.id}`
112112
sitemap.push({
113-
url: `${baseURL}${path}`,
113+
url: `${baseURL}/${path}`,
114114
alternates: alternateUrls(path),
115115
changeFrequency: 'yearly',
116116
priority: 0.4,
117117
lastModified: project.updatedAt,
118118
images: project.images?.flatMap((image) =>
119119
image.blockType === 'image'
120120
? `${baseURL}${(image.image as Media).url!}`
121-
: image.images!.map((image) => `${baseURL}${(image.image as Media).url!}`),
121+
: image.blockType === 'imageGroup'
122+
? image.images!.map((image) => `${baseURL}${(image.image as Media).url!}`)
123+
: '',
122124
),
123125
})
124126
})

0 commit comments

Comments
 (0)