@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/index.mjs CHANGED
@@ -2729,7 +2729,7 @@ function resolveLink(fromFilePath, linkPath, linkType, contentDir) {
2729
2729
  return linkPath;
2730
2730
  }
2731
2731
  const { isIndex, folder: sourceFolder, name: fileName } = getFileInfo(fromFilePath, contentDir);
2732
- const sourceParts = sourceFolder ? sourceFolder.split("/") : [];
2732
+ sourceFolder ? sourceFolder.split("/") : [];
2733
2733
  if (linkType === "dotslash" || linkType === "simple") {
2734
2734
  if (isIndex) {
2735
2735
  return sourceFolder ? `${sourceFolder}/${linkPath}` : linkPath;
@@ -2738,13 +2738,9 @@ function resolveLink(fromFilePath, linkPath, linkType, contentDir) {
2738
2738
  }
2739
2739
  }
2740
2740
  if (linkType === "parent") {
2741
- if (isIndex) {
2742
- const newParts = [...sourceParts];
2743
- newParts.pop();
2744
- return newParts.length ? `${newParts.join("/")}/${linkPath}` : linkPath;
2745
- } else {
2746
- return sourceParts.length ? `${sourceParts.join("/")}/${linkPath}` : linkPath;
2747
- }
2741
+ const base = sourceFolder ? `/${sourceFolder}` : "/";
2742
+ const resolved = path.posix.resolve(base, `../${linkPath}`);
2743
+ return resolved.replace(/^\//, "");
2748
2744
  }
2749
2745
  return linkPath;
2750
2746
  }