Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue #696: Add rel for external links #697

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export default function Footer() {
<a
href="https://discord.gg/deno"
target="_blank"
rel="noopener noreferrer"
aria-label="Deno SaaSKit on Discord"
class="link-styles"
>
Expand All @@ -74,6 +75,7 @@ export default function Footer() {
<a
href="https://github.com/denoland/saaskit"
target="_blank"
rel="noopener noreferrer"
aria-label="Deno SaaSKit repo on GitHub"
class="link-styles"
>
Expand Down
1 change: 1 addition & 0 deletions islands/ItemsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ function ItemSummary(props: ItemSummaryProps) {
class="hover:underline text-gray-500 after:content-['_↗']"
href={props.item.url}
target="_blank"
rel="noopener noreferrer"
>
{new URL(props.item.url).host}
</a>
Expand Down
11 changes: 10 additions & 1 deletion plugins/blog/components/Share.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ import IconBrandLinkedin from "tabler_icons_tsx/brand-linkedin.tsx";
import IconBrandReddit from "tabler_icons_tsx/brand-reddit.tsx";
import IconBrandTwitter from "tabler_icons_tsx/brand-twitter.tsx";

interface ShareProps {
url: URL;
title: string;
}

/**
* Dynamically generates links for sharing the current content on the major
* social media platforms.
*
* @see {@link https://schier.co/blog/pure-html-share-buttons}
*/
export default function Share(props: { url: URL; title: string }) {
export default function Share(props: ShareProps) {
return (
<div class="flex flex-row gap-4 my-4">
<span class="align-middle">Share</span>
Expand All @@ -19,6 +24,7 @@ export default function Share(props: { url: URL; title: string }) {
encodeURIComponent(props.url.href)
}`}
target="_blank"
rel="noopener noreferrer"
aria-label={`Share ${props.title} on Facebook`}
>
<IconBrandFacebook />
Expand All @@ -28,6 +34,7 @@ export default function Share(props: { url: URL; title: string }) {
encodeURIComponent(props.url.href)
}&title=${encodeURIComponent(props.title)}`}
target="_blank"
rel="noopener noreferrer"
aria-label={`Share ${props.title} on LinkedIn`}
>
<IconBrandLinkedin />
Expand All @@ -37,6 +44,7 @@ export default function Share(props: { url: URL; title: string }) {
encodeURIComponent(props.url.href)
}&title=${encodeURIComponent(props.title)}`}
target="_blank"
rel="noopener noreferrer"
aria-label={`Share ${props.title} on Reddit`}
>
<IconBrandReddit />
Expand All @@ -46,6 +54,7 @@ export default function Share(props: { url: URL; title: string }) {
encodeURIComponent(props.url.href)
}&text=${encodeURIComponent(props.title)}`}
target="_blank"
rel="noopener noreferrer"
aria-label={`Share ${props.title} on Twitter`}
>
<IconBrandTwitter />
Expand Down
1 change: 1 addition & 0 deletions routes/users/[login].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function UserProfile(props: UserProfileProps) {
aria-label={`${props.login}'s GitHub profile`}
class="link-styles"
target="_blank"
rel="noopener noreferrer"
>
<IconBrandGithub class="w-6" />
</a>
Expand Down
Loading