Skip to content

Commit 0f23340

Browse files
authored
fix: open external links in new tabs (#379)
It is a good practice to open external links in new tabs.
1 parent 24cf84e commit 0f23340

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

frontend/routes/docs/[...id].tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ export default function Page({ data }: PageProps<Data, State>) {
7474
<a
7575
class="link"
7676
href={`https://github.com/jsr-io/jsr/blob/main/frontend/docs/${data.id}.md`}
77+
target="_blank"
78+
rel="noopener noreferrer"
7779
>
7880
Edit this page on GitHub
7981
</a>

frontend/routes/package/(_components)/PackageHeader.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ export function PackageHeader(
113113
<a
114114
class="chip sm:big-chip bg-jsr-gray-0 !inline-flex items-center gap-1 select-none"
115115
href={`https://github.com/${pkg.githubRepository.owner}/${pkg.githubRepository.name}`}
116+
target="_blank"
117+
rel="noopener noreferrer"
116118
>
117119
<GitHub class="text-black !size-4" />
118120
<span>

frontend/routes/package/publish.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ export default function PackagePage({
8282
</pre>
8383
<p>
8484
The version must be in{" "}
85-
<a href="https://semver.org" class="link">
85+
<a
86+
href="https://semver.org"
87+
class="link"
88+
target="_blank"
89+
rel="noopener noreferrer"
90+
>
8691
SemVer
8792
</a>{" "}
8893
format.
@@ -204,6 +209,8 @@ function GitHubActions({ pkg, canEdit, user }: {
204209
<a
205210
href={`https://github.com/${pkg.githubRepository.owner}/${pkg.githubRepository.name}`}
206211
class="link"
212+
target="_blank"
213+
rel="noopener noreferrer"
207214
>
208215
{pkg.githubRepository.owner}/{pkg.githubRepository.name}
209216
</a>
@@ -212,6 +219,8 @@ function GitHubActions({ pkg, canEdit, user }: {
212219
<a
213220
href="https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect"
214221
class="hover:underline"
222+
target="_blank"
223+
rel="noopener noreferrer"
215224
>
216225
OIDC
217226
</a>

0 commit comments

Comments
 (0)