diff --git a/.env.example b/.env.example
index 4b0ca7a1..1563be05 100644
--- a/.env.example
+++ b/.env.example
@@ -15,7 +15,7 @@ NEXT_PUBLIC_UMAMI_WEBSITE_ID=
# optional. the base URL of a self-hosted Umami instance (including https://) to proxy requests to. if the website ID is
# set but this isn't, the managed Umami Cloud endpoint is used.
# https://umami.is/docs/bypass-ad-blockers
-NEXT_PUBLIC_UMAMI_HOST=
+NEXT_PUBLIC_UMAMI_URL=
# optional. enables comments on blog posts via GitHub discussions.
# https://giscus.app/
diff --git a/app/api/hits/route.ts b/app/api/hits/route.ts
index 69955c7a..90b39b41 100644
--- a/app/api/hits/route.ts
+++ b/app/api/hits/route.ts
@@ -4,12 +4,12 @@ import type { hits as Hits } from "@prisma/client";
export const revalidate = 900; // 15 mins
-export async function GET(): Promise<
+export const GET = async (): Promise<
NextResponse<{
total: Pick;
pages: Hits[];
}>
-> {
+> => {
// fetch all rows from db sorted by most hits
const pages = await prisma.hits.findMany({
orderBy: [
@@ -28,4 +28,4 @@ export async function GET(): Promise<
});
return NextResponse.json({ total, pages });
-}
+};
diff --git a/app/birthday/page.tsx b/app/birthday/page.tsx
index 45553c5c..10dfee9d 100644
--- a/app/birthday/page.tsx
+++ b/app/birthday/page.tsx
@@ -20,7 +20,7 @@ export const metadata: Metadata = {
},
};
-export default function Page() {
+const Page = () => {
return (
<>
1996.mov
@@ -28,4 +28,6 @@ export default function Page() {
>
);
-}
+};
+
+export default Page;
diff --git a/app/contact/actions.ts b/app/contact/actions.ts
index 0408d9fa..5736f82f 100644
--- a/app/contact/actions.ts
+++ b/app/contact/actions.ts
@@ -3,7 +3,7 @@
import { headers } from "next/headers";
import { z } from "zod";
import { Resend } from "resend";
-import config from "../../lib/config/constants";
+import config from "../../lib/config";
const schema = z.object({
name: z.string().min(1, { message: "Name is required" }),
@@ -12,7 +12,7 @@ const schema = z.object({
["cf-turnstile-response"]: z.string().min(1, { message: "CAPTCHA not completed" }),
});
-export async function sendMessage(
+export const sendMessage = async (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
prevState: any,
formData: FormData
@@ -21,7 +21,7 @@ export async function sendMessage(
message: string;
errors?: z.inferFormattedError;
payload?: FormData;
-}> {
+}> => {
try {
const validatedFields = schema.safeParse(Object.fromEntries(formData));
@@ -85,4 +85,4 @@ export async function sendMessage(
payload: formData,
};
}
-}
+};
diff --git a/app/contact/form.tsx b/app/contact/form.tsx
index 457e92ec..3a9215f5 100644
--- a/app/contact/form.tsx
+++ b/app/contact/form.tsx
@@ -71,7 +71,7 @@ const ContactForm = () => {
}}
xmlns="http://www.w3.org/2000/svg"
>
-
+
{" "}
Basic{" "}
diff --git a/app/contact/page.tsx b/app/contact/page.tsx
index b81e6f47..7cf148c1 100644
--- a/app/contact/page.tsx
+++ b/app/contact/page.tsx
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
},
};
-export default function Page() {
+const Page = () => {
return (
);
-}
+};
+
+export default Page;
diff --git a/app/hillary/page.tsx b/app/hillary/page.tsx
index 8edd2765..881a2e66 100644
--- a/app/hillary/page.tsx
+++ b/app/hillary/page.tsx
@@ -21,7 +21,7 @@ export const metadata: Metadata = {
},
};
-export default function Page() {
+const Page = () => {
return (
<>
HRC.mov
@@ -60,4 +60,6 @@ export default function Page() {
>
);
-}
+};
+
+export default Page;
diff --git a/app/layout.tsx b/app/layout.tsx
index 44851a14..67e7cf04 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -4,7 +4,7 @@ import { ThemeProvider } from "../contexts/ThemeContext";
import Header from "../components/Header";
import Footer from "../components/Footer";
import { SkipToContentLink, SkipToContentTarget } from "../components/SkipToContent";
-import config from "../lib/config/constants";
+import config from "../lib/config";
import type { Metadata } from "next";
import type { Person, WithContext } from "schema-dts";
@@ -37,9 +37,14 @@ export const metadata: Metadata = {
{
url: meJpg.src,
alt: `${config.siteName} – ${config.shortDescription}`,
+ width: meJpg.width,
+ height: meJpg.height,
},
],
},
+ twitter: {
+ creator: `@${config.authorSocial?.twitter}`,
+ },
alternates: {
canonical: "/",
types: {
@@ -83,7 +88,7 @@ const jsonLd: WithContext = {
],
};
-export default function RootLayout({ children }: { children: React.ReactNode }) {
+const RootLayout = ({ children }: { children: React.ReactNode }) => {
return (
@@ -110,4 +115,6 @@ export default function RootLayout({ children }: { children: React.ReactNode })
);
-}
+};
+
+export default RootLayout;
diff --git a/app/leo/page.tsx b/app/leo/page.tsx
index 7d796d9c..d7d8aedf 100644
--- a/app/leo/page.tsx
+++ b/app/leo/page.tsx
@@ -21,7 +21,7 @@ export const metadata: Metadata = {
},
};
-export default function Page() {
+const Page = () => {
return (
<>
TheLab.mov
@@ -49,4 +49,6 @@ export default function Page() {
>
);
-}
+};
+
+export default Page;
diff --git a/app/manifest.ts b/app/manifest.ts
index f6911f8f..a2b727ed 100644
--- a/app/manifest.ts
+++ b/app/manifest.ts
@@ -1,4 +1,4 @@
-import config from "../lib/config/constants";
+import config from "../lib/config";
import type { MetadataRoute } from "next";
const manifest = (): MetadataRoute.Manifest => {
diff --git a/app/not-found.tsx b/app/not-found.tsx
index 9684968f..74797aba 100644
--- a/app/not-found.tsx
+++ b/app/not-found.tsx
@@ -11,7 +11,7 @@ export const metadata: Metadata = {
},
};
-export default async function Page() {
+const Page = () => {
return (
);
-}
+};
+
+export default Page;
diff --git a/app/notes/[slug]/page.tsx b/app/notes/[slug]/page.tsx
index 33454a78..fc7612e7 100644
--- a/app/notes/[slug]/page.tsx
+++ b/app/notes/[slug]/page.tsx
@@ -8,7 +8,7 @@ import Loading from "../../../components/Loading";
import HitCounter from "./counter";
import { getPostSlugs, getFrontMatter } from "../../../lib/helpers/posts";
import { metadata as defaultMetadata } from "../../layout";
-import config from "../../../lib/config/constants";
+import config from "../../../lib/config";
import type { Metadata, Route } from "next";
import type { Article, WithContext } from "schema-dts";
@@ -20,16 +20,16 @@ export const dynamicParams = false;
// https://nextjs.org/docs/app/building-your-application/rendering/partial-prerendering#using-partial-prerendering
export const experimental_ppr = true;
-export async function generateStaticParams() {
+export const generateStaticParams = async () => {
const slugs = await getPostSlugs();
// map slugs into a static paths object required by next.js
return slugs.map((slug) => ({
slug,
}));
-}
+};
-export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }): Promise {
+export const generateMetadata = async ({ params }: { params: Promise<{ slug: string }> }): Promise => {
const { slug } = await params;
const frontmatter = await getFrontMatter(slug);
@@ -54,9 +54,9 @@ export async function generateMetadata({ params }: { params: Promise<{ slug: str
canonical: `/notes/${slug}`,
},
};
-}
+};
-export default async function Page({ params }: { params: Promise<{ slug: string }> }) {
+const Page = async ({ params }: { params: Promise<{ slug: string }> }) => {
const { slug } = await params;
const frontmatter = await getFrontMatter(slug);
@@ -153,4 +153,6 @@ export default async function Page({ params }: { params: Promise<{ slug: string
)}
>
);
-}
+};
+
+export default Page;
diff --git a/app/notes/page.tsx b/app/notes/page.tsx
index b1868f04..a4aeecae 100644
--- a/app/notes/page.tsx
+++ b/app/notes/page.tsx
@@ -1,7 +1,7 @@
import Link from "../../components/Link";
import Time from "../../components/Time";
import { getAllPosts } from "../../lib/helpers/posts";
-import config from "../../lib/config/constants";
+import config from "../../lib/config";
import { metadata as defaultMetadata } from "../layout";
import type { ReactElement } from "react";
import type { Metadata, Route } from "next";
@@ -23,7 +23,7 @@ export const metadata: Metadata = {
},
};
-export default async function Page() {
+const Page = async () => {
// parse the year of each note and group them together
const notes = await getAllPosts();
const notesByYear: {
@@ -58,5 +58,7 @@ export default async function Page() {
// grouped posts enter this component ordered chronologically -- we want reverse chronological
const reversed = sections.reverse();
- return <>{reversed}>;
-}
+ return reversed;
+};
+
+export default Page;
diff --git a/app/page.tsx b/app/page.tsx
index 89872a55..732e0de3 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -34,7 +34,7 @@ const Link = ({
);
};
-export default function Page() {
+const Page = () => {
return (
@@ -286,4 +286,6 @@ export default function Page() {
);
-}
+};
+
+export default Page;
diff --git a/app/previously/page.tsx b/app/previously/page.tsx
index 3f680dbd..4d235436 100644
--- a/app/previously/page.tsx
+++ b/app/previously/page.tsx
@@ -38,7 +38,7 @@ export const metadata: Metadata = {
},
};
-export default async function Page() {
+const Page = () => {
return (
-
+
{" "}
Click here for the
full experience anyway.
@@ -96,7 +96,6 @@ export default async function Page() {
@@ -188,4 +187,6 @@ export default async function Page() {
);
-}
+};
+
+export default Page;
diff --git a/app/projects/page.tsx b/app/projects/page.tsx
index 35e5f173..7e1acf6d 100644
--- a/app/projects/page.tsx
+++ b/app/projects/page.tsx
@@ -4,7 +4,7 @@ import PageTitle from "../../components/PageTitle";
import Link from "../../components/Link";
import RelativeTime from "../../components/RelativeTime";
import commaNumber from "comma-number";
-import config from "../../lib/config/constants";
+import config from "../../lib/config";
import { metadata as defaultMetadata } from "../layout";
import type { Metadata } from "next";
import type { User, Repository } from "@octokit/graphql-schema";
@@ -39,7 +39,7 @@ type Project = {
updatedAt: string;
};
-async function getRepos(): Promise {
+const getRepos = async (): Promise => {
// don't fail the entire site build if the required API key for this page is missing
if (!process.env.GITHUB_TOKEN) {
console.warn(`ERROR: I can't fetch any GitHub projects without "GITHUB_TOKEN" set! Skipping for now...`);
@@ -102,9 +102,9 @@ async function getRepos(): Promise {
}));
return repos;
-}
+};
-export default async function Page() {
+const Page = async () => {
const repos = await getRepos();
return (
@@ -190,11 +190,13 @@ export default async function Page() {
fill: "var(--colors-text)",
}}
>
-
+
{" "}
GitHub...
>
);
-}
+};
+
+export default Page;
diff --git a/app/robots.ts b/app/robots.ts
index 8ae32024..8fb608c6 100644
--- a/app/robots.ts
+++ b/app/robots.ts
@@ -1,4 +1,4 @@
-import config from "../lib/config/constants";
+import config from "../lib/config";
import type { MetadataRoute } from "next";
export const dynamic = "force-static";
diff --git a/app/sitemap.ts b/app/sitemap.ts
index f092adc5..a919b560 100644
--- a/app/sitemap.ts
+++ b/app/sitemap.ts
@@ -1,7 +1,7 @@
import path from "path";
import glob from "fast-glob";
import { getAllPosts } from "../lib/helpers/posts";
-import config from "../lib/config/constants";
+import config from "../lib/config";
import type { MetadataRoute } from "next";
export const dynamic = "force-static";
diff --git a/app/zip/page.tsx b/app/zip/page.tsx
index 1a124230..bf55560d 100644
--- a/app/zip/page.tsx
+++ b/app/zip/page.tsx
@@ -19,7 +19,7 @@ export const metadata: Metadata = {
},
};
-export default async function Page() {
+const Page = () => {
return (
);
-}
+};
+
+export default Page;
diff --git a/components/Blockquote/Blockquote.tsx b/components/Blockquote/Blockquote.tsx
index a07c7fc3..33feec8a 100644
--- a/components/Blockquote/Blockquote.tsx
+++ b/components/Blockquote/Blockquote.tsx
@@ -3,7 +3,9 @@ import type { ComponentPropsWithoutRef } from "react";
import styles from "./Blockquote.module.css";
-const Blockquote = ({ className, ...rest }: ComponentPropsWithoutRef<"blockquote">) => (
+export type BlockquoteProps = ComponentPropsWithoutRef<"blockquote">;
+
+const Blockquote = ({ className, ...rest }: BlockquoteProps) => (
);
diff --git a/components/CodeInline/CodeInline.tsx b/components/CodeInline/CodeInline.tsx
index 38cd3dbb..a31a6a8b 100644
--- a/components/CodeInline/CodeInline.tsx
+++ b/components/CodeInline/CodeInline.tsx
@@ -3,7 +3,9 @@ import type { ComponentPropsWithoutRef } from "react";
import styles from "./CodeInline.module.css";
-const CodeInline = ({ className, ...rest }: ComponentPropsWithoutRef<"code">) => (
+export type CodeInlineProps = ComponentPropsWithoutRef<"code">;
+
+const CodeInline = ({ className, ...rest }: CodeInlineProps) => (
);
diff --git a/components/CodePen/CodePen.tsx b/components/CodePen/CodePen.tsx
index 6d35a2ba..82409e3c 100644
--- a/components/CodePen/CodePen.tsx
+++ b/components/CodePen/CodePen.tsx
@@ -22,9 +22,7 @@ const CodePen = ({
preview: `${!!preview}`,
editable: `${!!editable}`,
})}`}
- scrolling="no"
- sandbox="allow-same-origin allow-scripts allow-popups allow-top-navigation-by-user-activation"
- style={{ height: `${height}px`, width: "100%", border: "0" }}
+ style={{ height: `${height}px`, width: "100%", border: "0", overflow: "hidden" }}
/>
);
};
diff --git a/components/Comments/Comments.tsx b/components/Comments/Comments.tsx
index 75c52c01..05ce3c02 100644
--- a/components/Comments/Comments.tsx
+++ b/components/Comments/Comments.tsx
@@ -1,7 +1,7 @@
"use client";
import Giscus from "@giscus/react";
-import config from "../../lib/config/constants";
+import config from "../../lib/config";
import type { GiscusProps } from "@giscus/react";
export type CommentsProps = {
diff --git a/components/Footer/Footer.tsx b/components/Footer/Footer.tsx
index 6f1f1015..6e895004 100644
--- a/components/Footer/Footer.tsx
+++ b/components/Footer/Footer.tsx
@@ -1,7 +1,7 @@
import clsx from "clsx";
import { HeartIcon } from "lucide-react";
import Link from "../Link";
-import config from "../../lib/config/constants";
+import config from "../../lib/config";
import type { ComponentPropsWithoutRef } from "react";
import styles from "./Footer.module.css";
@@ -47,7 +47,7 @@ const Footer = ({ className, ...rest }: FooterProps) => {
width="1.25em"
className={styles.icon}
>
-
+
.{" "}
diff --git a/components/Gist/Gist.tsx b/components/Gist/Gist.tsx
index 77e72f1e..4963ec5d 100644
--- a/components/Gist/Gist.tsx
+++ b/components/Gist/Gist.tsx
@@ -12,7 +12,7 @@ const Gist = async ({ id, file }: GistProps) => {
const scriptResponse = await fetch(scriptUrl);
if (!scriptResponse.ok) {
- console.warn(`[gist] fetching js for https://gist.github.com/${id} failed:`, scriptResponse.statusText);
+ console.warn(`[gist] failed to fetch js:`, scriptResponse.statusText);
return (
@@ -33,10 +33,9 @@ const Gist = async ({ id, file }: GistProps) => {
scrolling="no"
id={iframeId}
srcDoc={iframeHtml}
- sandbox="allow-same-origin allow-scripts allow-popups allow-top-navigation-by-user-activation"
style={{ border: "0", overflow: "hidden" }}
suppressHydrationWarning
- >
+ />
);
};
diff --git a/components/Header/Header.tsx b/components/Header/Header.tsx
index 99c6f039..88477f89 100644
--- a/components/Header/Header.tsx
+++ b/components/Header/Header.tsx
@@ -2,7 +2,7 @@ import clsx from "clsx";
import Link from "../Link";
import Image from "../Image";
import Menu from "../Menu";
-import config from "../../lib/config/constants";
+import config from "../../lib/config";
import type { ComponentPropsWithoutRef } from "react";
import styles from "./Header.module.css";
diff --git a/components/HorizontalRule/HorizontalRule.tsx b/components/HorizontalRule/HorizontalRule.tsx
index a678b52b..ec2d5138 100644
--- a/components/HorizontalRule/HorizontalRule.tsx
+++ b/components/HorizontalRule/HorizontalRule.tsx
@@ -3,7 +3,9 @@ import type { ComponentPropsWithoutRef } from "react";
import styles from "./HorizontalRule.module.css";
-const HorizontalRule = ({ className, ...rest }: ComponentPropsWithoutRef<"hr">) => (
+export type HorizontalRuleProps = ComponentPropsWithoutRef<"hr">;
+
+const HorizontalRule = ({ className, ...rest }: HorizontalRuleProps) => (
);
diff --git a/components/Link/Link.tsx b/components/Link/Link.tsx
index fafd9b70..1943fb3d 100644
--- a/components/Link/Link.tsx
+++ b/components/Link/Link.tsx
@@ -1,7 +1,7 @@
import NextLink from "next/link";
import clsx from "clsx";
import objStr from "obj-str";
-import config from "../../lib/config/constants";
+import config from "../../lib/config";
import type { ComponentPropsWithoutRef } from "react";
import styles from "./Link.module.css";
diff --git a/contexts/ThemeContext.tsx b/contexts/ThemeContext.tsx
index f14b4ffb..9f37ad19 100644
--- a/contexts/ThemeContext.tsx
+++ b/contexts/ThemeContext.tsx
@@ -79,7 +79,8 @@ export const ThemeProvider = ({ children }: PropsWithChildren) => {
id="restore-theme"
// unminified: https://gist.github.com/jakejarvis/79b0ec8506bc843023546d0d29861bf0
dangerouslySetInnerHTML={{
- __html: `(()=>{try{const e=document.documentElement,t="undefined"!=typeof Storage?window.localStorage.getItem("theme"):null,a=(t&&"dark"===t)??window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";e.dataset.theme=a,e.style.colorScheme=a}catch(e){}})()`,
+ __html:
+ "(()=>{try{const e=document.documentElement,t='undefined'!=typeof Storage?window.localStorage.getItem('theme'):null,a=(t&&'dark'===t)??window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';e.dataset.theme=a,e.style.colorScheme=a}catch(e){}})()",
}}
/>
diff --git a/lib/config/constants.ts b/lib/config/index.ts
similarity index 90%
rename from lib/config/constants.ts
rename to lib/config/index.ts
index 8188672e..b3cb138f 100644
--- a/lib/config/constants.ts
+++ b/lib/config/index.ts
@@ -1,8 +1,9 @@
-const constants = {
+const config = {
// Site info
siteName: "Jake Jarvis",
siteLocale: "en-US",
baseUrl:
+ // same logic as metadataBase: https://nextjs.org/docs/app/api-reference/functions/generate-metadata#default-value
process.env.NEXT_PUBLIC_VERCEL_ENV === "production" && process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL
? `https://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`
: process.env.NEXT_PUBLIC_VERCEL_ENV === "preview" && process.env.NEXT_PUBLIC_VERCEL_URL
@@ -35,4 +36,4 @@ const constants = {
},
};
-export default constants;
+export default config;
diff --git a/lib/helpers/build-feed.ts b/lib/helpers/build-feed.ts
index 7df9dd55..c3adb6ff 100644
--- a/lib/helpers/build-feed.ts
+++ b/lib/helpers/build-feed.ts
@@ -1,6 +1,6 @@
import { Feed } from "feed";
import { getAllPosts } from "./posts";
-import config from "../config/constants";
+import config from "../config";
import meJpg from "../../app/me.jpg";
diff --git a/lib/helpers/format-date.ts b/lib/helpers/format-date.ts
index 3acd0cc9..6a9ee600 100644
--- a/lib/helpers/format-date.ts
+++ b/lib/helpers/format-date.ts
@@ -5,7 +5,7 @@ import dayjsRelativeTime from "dayjs/plugin/relativeTime";
import dayjsLocalizedFormat from "dayjs/plugin/localizedFormat";
import dayjsAdvancedFormat from "dayjs/plugin/advancedFormat";
import "dayjs/locale/en";
-import config from "../config/constants";
+import config from "../config";
const IsomorphicDayJs = (date?: dayjs.ConfigType): dayjs.Dayjs => {
// plugins
diff --git a/lib/helpers/posts.ts b/lib/helpers/posts.ts
index c97a37cc..a08de64c 100644
--- a/lib/helpers/posts.ts
+++ b/lib/helpers/posts.ts
@@ -3,7 +3,7 @@ import glob from "fast-glob";
import pMap from "p-map";
import pMemoize from "p-memoize";
import { formatDate } from "./format-date";
-import config from "../config/constants";
+import config from "../config";
// path to directory with .mdx files, relative to project root
const POSTS_DIR = "notes";
diff --git a/mdx-components.ts b/mdx-components.ts
index 43ef45e4..af0e4c24 100644
--- a/mdx-components.ts
+++ b/mdx-components.ts
@@ -14,7 +14,7 @@ import YouTube from "./components/YouTube";
import Gist from "./components/Gist";
import CodePen from "./components/CodePen";
-export function useMDXComponents(components: MDXComponents): MDXComponents {
+export const useMDXComponents = (components: MDXComponents): MDXComponents => {
return {
...components,
@@ -44,4 +44,4 @@ export function useMDXComponents(components: MDXComponents): MDXComponents {
Gist,
CodePen,
};
-}
+};
diff --git a/middleware.ts b/middleware.ts
index 8fa75646..86709149 100644
--- a/middleware.ts
+++ b/middleware.ts
@@ -1,17 +1,17 @@
import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";
-import siteConfig from "./lib/config/constants";
+import siteConfig from "./lib/config";
// assign "short codes" to approved reverse proxy destinations. for example:
-// ["abc", "https://jakejarvis.github.io/blah"] => /_stream/abc/123.html -> https://jakejarvis.github.io/blah/123.html
+// ["abc", "https://jakejarvis.github.io"] => /_stream/abc/123.html -> https://jakejarvis.github.io/123.html
const rewritePrefix = "/_stream/";
const rewrites = new Map([
// umami backend, see https://umami.is/docs/guides/running-on-vercel#proxy-umami-analytics-via-vercel
- ["u", process.env.NEXT_PUBLIC_UMAMI_HOST || "https://cloud.umami.is"],
+ ["u", process.env.NEXT_PUBLIC_UMAMI_URL || "https://cloud.umami.is"],
]);
-export function middleware(request: NextRequest) {
+export const middleware = (request: NextRequest) => {
const headers = new Headers();
// https://gitweb.torproject.org/tor-browser-spec.git/tree/proposals/100-onion-location-header.txt
@@ -31,9 +31,6 @@ export function middleware(request: NextRequest) {
// search the rewrite map for the short code
const proxiedOrigin = rewrites.get(key);
- // TODO: remove debugging headers
- headers.set("x-middleware-proxy-key", key);
-
// return a 400 error if a rewrite was requested but the short code isn't found
if (!proxiedOrigin) {
return NextResponse.json(
@@ -50,7 +47,7 @@ export function middleware(request: NextRequest) {
const proxiedUrl = new URL(`${proxiedPath}${request.nextUrl.search}`, proxiedOrigin);
// TODO: remove debugging headers
- headers.set("x-middleware-proxy-to", proxiedUrl.toString());
+ headers.set("x-middleware-rewrite", proxiedUrl.toString());
// finally do the rewriting
return NextResponse.rewrite(proxiedUrl, {
@@ -64,7 +61,7 @@ export function middleware(request: NextRequest) {
request,
headers,
});
-}
+};
export const config = {
// save compute time by skipping middleware for static and metadata files
diff --git a/next.config.ts b/next.config.ts
index 7e7cd83b..19397efa 100644
--- a/next.config.ts
+++ b/next.config.ts
@@ -40,23 +40,13 @@ const nextConfig: NextConfig = {
],
},
],
- rewrites: async () => ({
- beforeFiles: [
- {
- // https://github.com/jakejarvis/tweets
- source: "/tweets/:path*",
- destination: "https://tweets-khaki.vercel.app/:path*",
- },
- ],
- afterFiles: [
- {
- // access security.txt, etc at both /security.txt and /.well-known/security.txt
- source: "/.well-known/:slug.txt",
- destination: "/:slug.txt",
- },
- ],
- fallback: [],
- }),
+ rewrites: async () => [
+ {
+ // https://github.com/jakejarvis/tweets
+ source: "/tweets/:path*",
+ destination: "https://tweets-khaki.vercel.app/:path*",
+ },
+ ],
redirects: async () => [
{ source: "/y2k", destination: "https://y2k.pages.dev", permanent: false },
{
diff --git a/notes/dark-mode/index.mdx b/notes/dark-mode/index.mdx
index ca82602a..2e6fbd57 100644
--- a/notes/dark-mode/index.mdx
+++ b/notes/dark-mode/index.mdx
@@ -28,7 +28,6 @@ I've written a simple implementation below, which...
title="Dark Mode Example"
loading="lazy"
style={{ height: "190px", width: "100%" }}
- sandbox="allow-same-origin allow-scripts allow-popups allow-top-navigation-by-user-activation"
>
A _very_ barebones example is embedded above ([view the source here](https://github.com/jakejarvis/dark-mode-example), or [open in a new window](https://jakejarvis.github.io/dark-mode-example/) if your browser is blocking the frame) and you can try it out on this site by clicking the 💡 lightbulb in the upper right corner of this page. You'll notice that the dark theme sticks when refreshing this page, navigating between other pages, or if you were to return to this example weeks from now.
diff --git a/public/humans.txt b/public/humans.txt
index da46c809..eb128e0a 100644
--- a/public/humans.txt
+++ b/public/humans.txt
@@ -35,7 +35,7 @@
- Umami
- Giscus
- Resend
- - ...and more: https://jarv.is/uses/
+ - ...and more: https://jarv.is/uses
# VIEW SOURCE
@@ -43,7 +43,7 @@
# PRIVACY POLICY
- https://jarv.is/privacy/
+ https://jarv.is/privacy
# TOR MIRROR
@@ -54,4 +54,4 @@
All content is licensed under CC-BY-4.0, an
open & permissive Creative Commons license:
- https://jarv.is/license/
+ https://jarv.is/license
diff --git a/public/security.txt b/public/security.txt
deleted file mode 100644
index 356c908f..00000000
--- a/public/security.txt
+++ /dev/null
@@ -1,24 +0,0 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA256
-
-Contact: https://jarv.is/contact/
-Encryption: https://jarv.is/pubkey.asc
-Encryption: openpgp4fpr:3bc6e5776bf379d36f6714802b0c9cf251e69a39
-Preferred-Languages: en
-Expires: 2025-01-01T06:00:00.000Z
------BEGIN PGP SIGNATURE-----
-
-iQIzBAEBCAAdFiEEO8bld2vzedNvZxSAKwyc8lHmmjkFAmXTsxwACgkQKwyc8lHm
-mjlwqA//ZyIYleG3sh5OeVpHS0mI4Tr5crR6SG08A5DEwe8ysbQqDhPx0LxodRMd
-XulfZ+TIDM3TXmw7LffeiKpRRFm0ecQtQT3hKorQgzHtUuKoPdr6gPC7Lrs9H7fE
-4QlAa/WM4M/yYJfW9HZnh1/2Lh5LulQ4dkGAhb5cBvSCAWYF3W0eLjUXI6xBWyzx
-FEnfTxsFCBd2h1g+S/Sc99mOvwHkcMOZflsiWCvXJb8ELwcusAK4SWYUM/bTJMil
-a3BzvYinjyGEGqX2u+SNp+6ZxFYpDUCq8Vl+LPUFvlYpfjqVjiK9knZBHo2YADH0
-6HPP+FdMUnZTd3gGwLsUS4NOcXWqqRivL9bWOVgklsoawjOeQtelgrGXrzhtIaYo
-bbUko3kpYBy9EkGKtefQ4BYAy3CTjFjfkeadm5EOXPFdEEPjQRqdfJdniHCYG+27
-xmriwobd2Ht+e3f0oOOf7Ae/ZD9MvaAA5Qn5uIbebVQaOxjetKbKGwDiPSLRJ5On
-zfOsJn2qY1NVjWG6IlqNHpI1vjzmNOsFFlknELg5NOFstpXvLYGX1TkqBnI2g3f4
-KuGXx4gOoq2oyoZuCi2bGO0Yn6lZ1UlEnfAO2ixW2FAPe8gqzxCeyxHzgvb4vNbr
-VpmZuRxsOcdCgvItZkYCaS164GYvRTPWCtC1Q3lzAZViCOgMUmk=
-=XWDQ
------END PGP SIGNATURE-----