Skip to content

Commit d9d4f52

Browse files
authored
Merge branch 'main' into DEV-3554-fix-vod
2 parents caaa934 + ae2f4bc commit d9d4f52

File tree

6 files changed

+30
-8
lines changed

6 files changed

+30
-8
lines changed

.changeset/clear-plants-clean.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"nextjs-website": patch
3+
---
4+
5+
Fix sitemap and metadata fetching to include locale support

.changeset/short-apples-hear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"chatbot-index": patch
3+
---
4+
5+
Fix unconsideration of English pages as dynamics ones

apps/chatbot-index/src/modules/documents.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,10 @@ def filter_urls(urls: List[str]) -> List[str]:
258258
if pattern.search(file) or pattern2.search(file):
259259
continue
260260

261+
# Check language code exclusion
262+
if "/en/" in file:
263+
continue
264+
261265
# Check static exclusions
262266
if "/auth/" in file or "/profile/" in file:
263267
continue

apps/nextjs-website/src/app/sitemap.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
159159
)
160160
);
161161
const guidesMetadataByDirNames = await getGuidesMetadataByDirNames(
162+
localeCode,
162163
guidesDirNames
163164
);
164165

@@ -181,6 +182,7 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
181182
)
182183
);
183184
const solutionsMetadata = await getSolutionsMetadataByDirNames(
185+
localeCode,
184186
solutionDirNames
185187
);
186188

@@ -225,7 +227,10 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
225227
);
226228

227229
const releaseNotesMetadataByDirNames =
228-
await getReleaseNotesMetadataByDirNames(releaseNotesDirNames);
230+
await getReleaseNotesMetadataByDirNames(
231+
localeCode,
232+
releaseNotesDirNames
233+
);
229234

230235
// Merge legacy and new metadata to ensure no missing content
231236
// Prioritize distributed metadata if duplicates exist (though they shouldn't)

apps/nextjs-website/src/helpers/s3Metadata.helpers.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,13 @@ export const getGuidesMetadata = async (locale: string, dirName?: string) => {
250250

251251
const removeTrailingSlash = (value: string) => value.replace(/\/+$/, '');
252252

253-
const buildDirMetadataPath = (dirName: string) => {
253+
const buildDirMetadataPath = (locale: string, dirName: string) => {
254254
const docsBase = s3DocsPath
255255
? removeTrailingSlash(s3DocsPath)
256256
: removeTrailingSlash(S3_PATH_TO_GITBOOK_DOCS);
257257
return docsBase
258-
? `${docsBase}/${dirName}/${S3_METADATA_JSON_PATH}`
259-
: `${dirName}/${S3_METADATA_JSON_PATH}`;
258+
? `${locale}/${docsBase}/${dirName}/${S3_METADATA_JSON_PATH}`
259+
: `${locale}/${dirName}/${S3_METADATA_JSON_PATH}`;
260260
};
261261

262262
async function batchFetchMetadata(
@@ -291,6 +291,7 @@ async function batchFetchMetadata(
291291
}
292292

293293
export const getGuidesMetadataByDirNames = async (
294+
locale: string,
294295
dirNames: readonly string[],
295296
concurrencyLimit = 5
296297
) => {
@@ -299,12 +300,13 @@ export const getGuidesMetadataByDirNames = async (
299300
}
300301

301302
const metadataPaths = dirNames.map((dirName) =>
302-
buildDirMetadataPath(dirName)
303+
buildDirMetadataPath(locale, dirName)
303304
);
304305
return await batchFetchMetadata(metadataPaths, concurrencyLimit);
305306
};
306307

307308
export const getSolutionsMetadataByDirNames = async (
309+
locale: string,
308310
dirNames: readonly string[],
309311
concurrencyLimit = 5
310312
) => {
@@ -313,7 +315,7 @@ export const getSolutionsMetadataByDirNames = async (
313315
}
314316

315317
const metadataPaths = dirNames.map((dirName) =>
316-
buildDirMetadataPath(dirName)
318+
buildDirMetadataPath(locale, dirName)
317319
);
318320
return await batchFetchMetadata(metadataPaths, concurrencyLimit);
319321
};
@@ -348,6 +350,7 @@ export const getSolutionsMetadata = async (
348350
};
349351

350352
export const getReleaseNotesMetadataByDirNames = async (
353+
locale: string,
351354
dirNames: readonly string[],
352355
concurrencyLimit = 5
353356
) => {
@@ -356,7 +359,7 @@ export const getReleaseNotesMetadataByDirNames = async (
356359
}
357360

358361
const metadataPaths = dirNames.map((dirName) =>
359-
buildDirMetadataPath(dirName)
362+
buildDirMetadataPath(locale, dirName)
360363
);
361364
return await batchFetchMetadata(metadataPaths, concurrencyLimit);
362365
};

apps/nextjs-website/src/lib/cmsApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export const getGuideProps = async (
193193

194194
export const getGuidesProps = async (locale: string) => {
195195
const strapiGuides = (await fetchResponseFromCDN(
196-
getSyncedGuidesResponseJsonFile
196+
`${locale}/${getSyncedGuidesResponseJsonFile}`
197197
)) as StrapiGuides | undefined;
198198
return strapiGuides ? makeGuidesProps(locale, strapiGuides) : [];
199199
};

0 commit comments

Comments
 (0)