seo: add data-nosnippet attribute and improve markdown type negotiation

This commit is contained in:
Dries Augustyns
2026-05-17 11:09:54 +02:00
parent 6759bffd2a
commit 53b631e6c6
3 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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';
+1
View File
@@ -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
>
<div className={'overflow-hidden rounded-[20px] border border-neutral-200 bg-white'}>
<div className={'flex items-center gap-5 p-6'}>
+1 -1
View File
@@ -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';