Why this matters
Next.js is a strong fit for proxy-free mode when you generate the discovery tags on the server and avoid client-only metadata injection.
Root Layout Tags
Add the Legible global tags in `app/layout.tsx` or your equivalent root head output so they are present in the initial HTML.
Page-Level Markdown Alternate
- Prefer `generateMetadata` or server-rendered head output over client components.
- If your route structure is nested, build the Legible URL from the exact slug or path format your hosted endpoint expects.
export async function generateMetadata({
params,
}: {
params: Promise<{ slug: string }>;
}) {
const { slug } = await params;
return {
alternates: {
types: {
"text/markdown": `https://read.yourdomain.com/${slug}.md`,
},
},
};
}Verification
- Use `View Source` and confirm the tags are in the initial HTML.
- Check one hosted Markdown endpoint and compare it with the visible page content.
- If the tag appears only after hydration, move it to server-rendered metadata.
