Skip to content

Commit

Permalink
link-markdown in new tab
Browse files Browse the repository at this point in the history
  • Loading branch information
nemanjam committed Mar 10, 2025
1 parent 3f4a8cd commit e3c621c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/working-notes/todo4.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ semantic release, conventional commits

// tailwind 4
git checkout feat/tailwind4-v2
----------
astro markdown link in new tab
```


5 changes: 4 additions & 1 deletion src/components/Link.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const linkVariants = cva('link-default', {
'no-underline': 'link-no-underline',
'link-heading': 'link-heading',
'link-nav': 'link-nav',
'link-markdown': 'link-markdown',
},
disabled: { true: 'link-disabled' },
},
Expand All @@ -27,5 +28,7 @@ const Element = disabled ? 'span' : 'a';
---

<Element class={linkVariants({ variant, disabled, className })} {...props}>
<slot />
<slot>
{props.href}
</slot>
</Element>
5 changes: 3 additions & 2 deletions src/content/project/2024/12-09-hackernews-new-jobs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ publishDate: 2024-12-09
---

import { Image } from 'astro:assets';
import Link from '../../../../components/Link.astro';
import { IMAGE_SIZES } from '../../../../constants/image';
import HackerNewsNewJobsImage from '../../../../content/project/2024/12-09-hackernews-new-jobs/_images/hackernews-new-jobs.png';

Expand All @@ -26,6 +27,6 @@ Amet tempor ut incididunt in fugiat nisi aute pariatur adipisicing ipsum eiusmod

## Links

- Demo: https://hackernews-new-jobs.arm1.nemanjamitic.com
- Repository: https://github.com/nemanjam/hn-new-jobs
- Demo: <Link href="https://hackernews-new-jobs.arm1.nemanjamitic.com" variant="link-markdown" target="_blank" title="HackerNews new jobs demo" />
- Repository: <Link href="https://github.com/nemanjam/hn-new-jobs" variant="link-markdown" target="_blank" title="HackerNews new jobs repository" />

4 changes: 4 additions & 0 deletions src/styles/components/link.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
@apply text-links no-underline;
}

.link-markdown {
@apply text-headings underline;
}

.link {
@apply hover:text-links-hover hover:underline;
@apply focus:text-links-hover focus:underline;
Expand Down

0 comments on commit e3c621c

Please sign in to comment.