Skip to content

Commit 1db920f

Browse files
committed
fixup!
1 parent bb9def3 commit 1db920f

3 files changed

Lines changed: 3 additions & 7 deletions

File tree

src/generators/orama-db/generate.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export async function generate(input) {
3737
description: paragraph
3838
? transformNodeToString(paragraph, true)
3939
: undefined,
40-
href: `${entry.path.slice(1)}.html#${entry.heading.data.slug}`,
40+
href: `${entry.path}.html#${entry.heading.data.slug}`,
4141
siteSection: headings[0].heading.data.name,
4242
};
4343
})

src/generators/web/ui/utils/relativeOrAbsolute.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,4 @@ import { useAbsoluteURLs, baseURL } from '#theme/config';
1111
* @returns {string}
1212
*/
1313
export const relativeOrAbsolute = (to, from) =>
14-
useAbsoluteURLs
15-
? `${baseURL.replace(/\/$/, '')}${to.replace(/\/$/, '')}`
16-
: relative(to, from);
14+
useAbsoluteURLs ? new URL(`.${to}`, baseURL).href : relative(to, from);

src/generators/web/utils/relativeOrAbsolute.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,5 @@ import { relative } from '../../../utils/url.mjs';
1212
export const relativeOrAbsolute = (to, from) => {
1313
const { useAbsoluteURLs, baseURL } = getConfig('web');
1414

15-
return useAbsoluteURLs
16-
? `${baseURL.replace(/\/$/, '')}${to.replace(/\/$/, '')}`
17-
: relative(to, from);
15+
return useAbsoluteURLs ? new URL(`.${to}`, baseURL).href : relative(to, from);
1816
};

0 commit comments

Comments
 (0)