Skip to content

Commit

Permalink
Fix base link highlight.
Browse files Browse the repository at this point in the history
  • Loading branch information
amyjko committed Mar 17, 2024
1 parent db29abe commit 24a37ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/components/Link.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
export let at: string | undefined = undefined;
$: path = $page.url.pathname;
$: console.log(path);
$: console.log(base);
</script>

{#if at && (at === '/' ? path === `${base}` : path === `${base}${at}`)}
{#if at && (at === '/' ? path === `${base}/` : path === `${base}${at}`)}
<span class="at"><slot /></span>
{:else if to.startsWith('http')}
<a href={to} target="_blank" rel="noreferrer"><slot /></a>
Expand Down

0 comments on commit 24a37ec

Please sign in to comment.