Skip to content

Commit

Permalink
Make projects open in new tab
Browse files Browse the repository at this point in the history
  • Loading branch information
efergus committed Aug 2, 2024
1 parent aef53c4 commit 1bff83e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/Card.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
export let scroll = true;
</script>

<ConditionalLink {link}>
<ConditionalLink {link} external={true}>
<div
class="flex flex-col border rounded-lg shadow px-4 py-2 h-full w-full gap-2"
>
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/ConditionalLink.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<script lang="ts">
export let link: string | undefined = undefined;
export let external = false;
</script>

{#if link}
<a href={link}><slot /></a>
<a href={link} target={external ? "_blank" : ""}><slot /></a>
{:else}
<slot />
{/if}

0 comments on commit 1bff83e

Please sign in to comment.