Skip to content

Commit 5897c23

Browse files
committed
linkz
1 parent 5a905e3 commit 5897c23

File tree

4 files changed

+40
-11
lines changed

4 files changed

+40
-11
lines changed

next.config.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ const nextConfig = {
5555
let redirects: NextRedirectItem[] = [];
5656

5757
for (let redirect of rees) {
58-
redirects.push({
59-
source: "/to/" + redirect.slug,
60-
destination: redirect.destination,
61-
permanent: true,
62-
});
58+
if (redirect.slashToLink) {
59+
redirects.push({
60+
source: "/to/" + redirect.slug,
61+
destination: redirect.destination,
62+
permanent: true,
63+
});
64+
}
6365
}
6466

6567
let someOtherRedirects = [

src/app/layout.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import MobileRedirect from "@/components/MobileRedirect";
2+
import { redirects } from "@/lib/defs";
13
import "@/styles/globals.css";
24
import { SpeedInsights } from "@vercel/speed-insights/next";
35
import type { Metadata, Viewport } from "next";
46
import localFont from "next/font/local";
57
import Script from "next/script";
6-
import MobileRedirect from "@/components/MobileRedirect";
7-
import { redirects } from "@/lib/defs";
88

99
const cuteNotes = localFont({
1010
src: [
@@ -320,9 +320,11 @@ export default function RootLayout({
320320
href="/apple-touch-icon.png?v=2"
321321
/>
322322

323-
{redirects.map((redirect) => (
324-
<link rel="me" href={redirect.destination} key={redirect.slug} />
325-
))}
323+
{redirects
324+
.filter((redirect) => redirect.linkrelme)
325+
.map((redirect) => (
326+
<link rel="me" href={redirect.destination} key={redirect.slug} />
327+
))}
326328

327329
<script
328330
type="application/ld+json"

src/lib/defs.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { RedirectItem, Project } from "./types";
1+
import { Project, RedirectItem } from "./types";
22

33
export const pages = [
44
"home",
@@ -21,92 +21,116 @@ export const redirects: RedirectItem[] = [
2121
slug: "github",
2222
destination: "https://github.com/jaspermayone",
2323
linkrelme: true,
24+
slashToLink: true,
2425
},
2526
{
2627
slug: "linkedin",
2728
destination: "https://www.linkedin.com/in/jaspermayone",
2829
linkrelme: true,
30+
slashToLink: true,
2931
},
3032
{
3133
slug: "bluesky",
3234
destination: "https://bsky.app/profile/jaspermayone.com",
3335
linkrelme: true,
36+
slashToLink: true,
3437
},
3538
{
3639
slug: "threads",
3740
destination: "https://www.threads.net/@jasper.mayone",
3841
linkrelme: true,
42+
slashToLink: true,
3943
},
4044
{
4145
slug: "x",
4246
destination: "https://x.com/jaspermayone",
4347
linkrelme: true,
48+
slashToLink: true,
4449
},
4550
{
4651
slug: "twitter",
4752
destination: "https://x.com/jaspermayone",
4853
linkrelme: true,
54+
slashToLink: true,
4955
},
5056
{
5157
slug: "youtube",
5258
destination: "https://www.youtube.com/@jasper.does.circus",
5359
linkrelme: true,
60+
slashToLink: true,
5461
},
5562
{
5663
slug: "buy-me-a-coffee",
5764
destination: "https://buymeacoffee.com/jaspermayone",
5865
linkrelme: true,
66+
slashToLink: true,
5967
},
6068
{
6169
slug: "reddit",
6270
destination: "https://www.reddit.com/user/j-dogcoder",
6371
linkrelme: true,
72+
slashToLink: true,
6473
},
6574
{
6675
slug: "matrix",
6776
destination: "https://matrix.to/#/@jasper.mayone:matrix.org",
6877
linkrelme: true,
78+
slashToLink: true,
6979
},
7080
{
7181
slug: "devto",
7282
destination: "https://dev.to/jaspermayone",
7383
linkrelme: true,
84+
slashToLink: true,
7485
},
7586
{
7687
slug: "hackerone",
7788
destination: "https://hackerone.com/jmayone",
7889
linkrelme: true,
90+
slashToLink: true,
7991
},
8092
{
8193
slug: "producthunt",
8294
destination: "https://www.producthunt.com/@jaspermayone",
8395
linkrelme: true,
96+
slashToLink: true,
8497
},
8598
{
8699
slug: "hackernews",
87100
destination: "https://news.ycombinator.com/user?id=jaspermayone",
88101
linkrelme: true,
102+
slashToLink: true,
89103
},
90104
{
91105
slug: "thingiverse",
92106
destination: "https://www.thingiverse.com/preamble6098/",
93107
linkrelme: true,
108+
slashToLink: true,
94109
},
95110
{
96111
slug: "keyoxide",
97112
destination:
98113
"https://keyoxide.org/00E643C21FAC965FFB28D3B714D0D45A1DADAAFA",
99114
linkrelme: true,
115+
slashToLink: true,
100116
},
101117
{
102118
slug: "signal",
103119
destination: "https://signal.me/#eu/jaspermayone.10",
104120
linkrelme: true,
121+
slashToLink: true,
105122
},
106123
{
107124
slug: "instagram",
108125
destination: "https://www.instagram.com/jasper.mayone",
109126
linkrelme: true,
127+
slashToLink: true,
128+
},
129+
{
130+
slug: "theaterengine",
131+
destination: "https://theaterengine.com/artists/7449",
132+
slashToLink: false,
133+
linkrelme: true,
110134
},
111135
];
112136

src/lib/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ export interface RedirectItem {
1818
slug: string;
1919
destination: string;
2020
linkrelme: boolean;
21+
slashToLink: boolean;
2122
}

0 commit comments

Comments
 (0)