From 53b631e6c6ed103fb45adff092af92a6158f81d8 Mon Sep 17 00:00:00 2001 From: Dries Augustyns Date: Sun, 17 May 2026 11:09:54 +0200 Subject: [PATCH] seo: add data-nosnippet attribute and improve markdown type negotiation --- apps/landing/src/middleware.ts | 2 +- apps/landing/src/pages/index.tsx | 1 + apps/wiki/middleware.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/landing/src/middleware.ts b/apps/landing/src/middleware.ts index 88f8326..e547910 100644 --- a/apps/landing/src/middleware.ts +++ b/apps/landing/src/middleware.ts @@ -28,7 +28,7 @@ function getQ(types: Array<{ type: string; q: number }>, target: string): number function negotiate(accept: string): Negotiated { if (!accept) return 'html'; const types = parseAccept(accept); - const mdQ = getQ(types, 'text/markdown'); + const mdQ = types.find(t => t.type === 'text/markdown')?.q ?? -1; const htmlQ = getQ(types, 'text/html'); if (mdQ <= 0 && htmlQ <= 0) return 'none'; if (mdQ > 0 && mdQ >= htmlQ) return 'markdown'; diff --git a/apps/landing/src/pages/index.tsx b/apps/landing/src/pages/index.tsx index aaffea1..d381697 100644 --- a/apps/landing/src/pages/index.tsx +++ b/apps/landing/src/pages/index.tsx @@ -725,6 +725,7 @@ export default function Index() { viewport={{once: true}} transition={{duration: 0.8, delay: 0.9, ease: [0.22, 1, 0.36, 1]}} className={'mx-auto max-w-xl'} + data-nosnippet >
diff --git a/apps/wiki/middleware.ts b/apps/wiki/middleware.ts index 39309a0..86aae4d 100644 --- a/apps/wiki/middleware.ts +++ b/apps/wiki/middleware.ts @@ -26,7 +26,7 @@ function getQ(types: Array<{ type: string; q: number }>, target: string): number function negotiate(accept: string): Negotiated { if (!accept) return 'html'; const types = parseAccept(accept); - const mdQ = getQ(types, 'text/markdown'); + const mdQ = types.find(t => t.type === 'text/markdown')?.q ?? -1; const htmlQ = getQ(types, 'text/html'); if (mdQ <= 0 && htmlQ <= 0) return 'none'; if (mdQ > 0 && mdQ >= htmlQ) return 'markdown';