fix: allow internal link resolver to resolve for "../" links as well (#3178)

* fix: allow internal link resolver to resolve for "../" links as well

* fix: amend getPageByHref to also work for "../" links
This commit is contained in:
Jamie Warburton
2026-04-02 19:13:22 +08:00
committed by GitHub
parent 9b88a564dc
commit 1473beec90
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@fumadocs/base-ui": patch
---
fix: allow internal link resolver to resolve for "../" links
+2 -2
View File
@@ -348,7 +348,7 @@ export function loader(
const [value, hash] = href.split('#', 2);
let target;
if (value.startsWith('./')) {
if (value.startsWith('./') || value.startsWith('../')) {
const path = joinPath(dir, value);
target = indexer.getPage(path, language);
@@ -363,7 +363,7 @@ export function loader(
};
},
resolveHref(href, parent) {
if (href.startsWith('./')) {
if (href.startsWith('./') || href.startsWith('../')) {
const target = this.getPageByHref(href, {
dir: path.dirname(parent.path),
language: parent.locale,