We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 21b57a5 commit 5717868Copy full SHA for 5717868
1 file changed
src/components/Link.astro
@@ -1,11 +1,18 @@
1
---
2
-const { url } = Astro.props;
+interface Props {
3
+ url: string;
4
+ self?: boolean;
5
+}
6
+
7
+const { url, self } = Astro.props;
8
+const target = self ? '_self' : '_blank';
9
10
11
<a
12
href={url}
- target='_blank'
- rel='noopener noreferrer'
13
+ target={target}
14
+ rel={target === '_blank' ? 'noopener noreferrer' : undefined}
15
class='not-prose font-normal text-blue-800 hover:text-blue-700 dark:text-blue-300 dark:hover:text-blue-200'
- ><slot /></a
16
>
17
+ <slot />
18
+</a>
0 commit comments