diff --git a/eng/generate-llms-txt.mjs b/eng/generate-llms-txt.mjs index bdffdfd3..7b95fdc7 100644 --- a/eng/generate-llms-txt.mjs +++ b/eng/generate-llms-txt.mjs @@ -78,7 +78,8 @@ function extractDescription(filePath, fileType) { * @returns {string} - Relative URL path */ function getRelativeUrl(filePath, baseDir) { - const relativePath = path.relative(ROOT_FOLDER, filePath); + const basePath = baseDir || ROOT_FOLDER; + const relativePath = path.relative(basePath, filePath); return relativePath.replace(/\\/g, "/"); }