@djangocfg/seo 2.1.203 → 2.1.205

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -3199,7 +3199,7 @@ function resolveLink(fromFilePath, linkPath, linkType, contentDir) {
3199
3199
  return linkPath;
3200
3200
  }
3201
3201
  const { isIndex, folder: sourceFolder, name: fileName } = getFileInfo(fromFilePath, contentDir);
3202
- const sourceParts = sourceFolder ? sourceFolder.split("/") : [];
3202
+ sourceFolder ? sourceFolder.split("/") : [];
3203
3203
  if (linkType === "dotslash" || linkType === "simple") {
3204
3204
  if (isIndex) {
3205
3205
  return sourceFolder ? `${sourceFolder}/${linkPath}` : linkPath;
@@ -3208,13 +3208,9 @@ function resolveLink(fromFilePath, linkPath, linkType, contentDir) {
3208
3208
  }
3209
3209
  }
3210
3210
  if (linkType === "parent") {
3211
- if (isIndex) {
3212
- const newParts = [...sourceParts];
3213
- newParts.pop();
3214
- return newParts.length ? `${newParts.join("/")}/${linkPath}` : linkPath;
3215
- } else {
3216
- return sourceParts.length ? `${sourceParts.join("/")}/${linkPath}` : linkPath;
3217
- }
3211
+ const base = sourceFolder ? `/${sourceFolder}` : "/";
3212
+ const resolved = path.posix.resolve(base, `../${linkPath}`);
3213
+ return resolved.replace(/^\//, "");
3218
3214
  }
3219
3215
  return linkPath;
3220
3216
  }