mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-26 10:55:57 +00:00
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:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@fumadocs/base-ui": patch
|
||||
---
|
||||
|
||||
fix: allow internal link resolver to resolve for "../" links
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user