feat(web): full SEO stack — metadata, JSON-LD, sitemap, robots, OG image
Ported and adapted from the BuildMyDiscord SEO setup:
- lib/seo.ts — single source for site constants, the FAQ data (shared by
the rendered FAQ and the FAQPage schema so they never drift) and JSON-LD
builders.
- Rich root metadata: title template, keywords, Open Graph, Twitter card,
robots directives, canonical.
- JSON-LD: Organization + WebSite + SoftwareApplication sitewide, FAQPage
on the landing page. No AggregateRating — there are no real reviews yet.
- app/robots.ts — allow all, explicit allow-list for AI answer-engine
crawlers (GPTBot, ClaudeBot, PerplexityBot, …), disallow private routes.
- app/sitemap.ts — every public marketing + docs route.
- app/opengraph-image.tsx — monochrome on-brand 1200x630 share card.
- app/manifest.ts + public/llms.txt.
- Per-page metadata for pricing, changelog, security, privacy, terms,
docs, templates and status.
- opengraph-image + apple-icon pinned to the edge runtime — next/og
crashes during a Node-runtime prerender.
Verified: next build passes; /robots.txt, /sitemap.xml,
/manifest.webmanifest and /opengraph-image all generate.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 19:16:40 +02:00
|
|
|
import { SITE_URL } from '@/lib/seo';
|
2026-05-31 12:08:05 +02:00
|
|
|
import { fetchPublicTemplateSlugs } from '@/lib/templates-server';
|
feat(web): full SEO stack — metadata, JSON-LD, sitemap, robots, OG image
Ported and adapted from the BuildMyDiscord SEO setup:
- lib/seo.ts — single source for site constants, the FAQ data (shared by
the rendered FAQ and the FAQPage schema so they never drift) and JSON-LD
builders.
- Rich root metadata: title template, keywords, Open Graph, Twitter card,
robots directives, canonical.
- JSON-LD: Organization + WebSite + SoftwareApplication sitewide, FAQPage
on the landing page. No AggregateRating — there are no real reviews yet.
- app/robots.ts — allow all, explicit allow-list for AI answer-engine
crawlers (GPTBot, ClaudeBot, PerplexityBot, …), disallow private routes.
- app/sitemap.ts — every public marketing + docs route.
- app/opengraph-image.tsx — monochrome on-brand 1200x630 share card.
- app/manifest.ts + public/llms.txt.
- Per-page metadata for pricing, changelog, security, privacy, terms,
docs, templates and status.
- opengraph-image + apple-icon pinned to the edge runtime — next/og
crashes during a Node-runtime prerender.
Verified: next build passes; /robots.txt, /sitemap.xml,
/manifest.webmanifest and /opengraph-image all generate.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 19:16:40 +02:00
|
|
|
import type { MetadataRoute } from 'next';
|
|
|
|
|
|
|
|
|
|
type Entry = {
|
|
|
|
|
path: string;
|
|
|
|
|
priority: number;
|
|
|
|
|
changeFrequency: MetadataRoute.Sitemap[number]['changeFrequency'];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const ROUTES: Entry[] = [
|
|
|
|
|
{ path: '/', priority: 1.0, changeFrequency: 'weekly' },
|
|
|
|
|
{ path: '/pricing', priority: 0.9, changeFrequency: 'weekly' },
|
|
|
|
|
{ path: '/templates', priority: 0.9, changeFrequency: 'daily' },
|
2026-05-31 12:08:05 +02:00
|
|
|
{ path: '/guides', priority: 0.8, changeFrequency: 'weekly' },
|
|
|
|
|
{ path: '/guides/host-mcp-server-with-oauth', priority: 0.8, changeFrequency: 'monthly' },
|
|
|
|
|
{ path: '/guides/hosted-mcp-platforms-compared', priority: 0.8, changeFrequency: 'monthly' },
|
|
|
|
|
{ path: '/guides/mintmcp-alternative', priority: 0.7, changeFrequency: 'monthly' },
|
feat(web): full SEO stack — metadata, JSON-LD, sitemap, robots, OG image
Ported and adapted from the BuildMyDiscord SEO setup:
- lib/seo.ts — single source for site constants, the FAQ data (shared by
the rendered FAQ and the FAQPage schema so they never drift) and JSON-LD
builders.
- Rich root metadata: title template, keywords, Open Graph, Twitter card,
robots directives, canonical.
- JSON-LD: Organization + WebSite + SoftwareApplication sitewide, FAQPage
on the landing page. No AggregateRating — there are no real reviews yet.
- app/robots.ts — allow all, explicit allow-list for AI answer-engine
crawlers (GPTBot, ClaudeBot, PerplexityBot, …), disallow private routes.
- app/sitemap.ts — every public marketing + docs route.
- app/opengraph-image.tsx — monochrome on-brand 1200x630 share card.
- app/manifest.ts + public/llms.txt.
- Per-page metadata for pricing, changelog, security, privacy, terms,
docs, templates and status.
- opengraph-image + apple-icon pinned to the edge runtime — next/og
crashes during a Node-runtime prerender.
Verified: next build passes; /robots.txt, /sitemap.xml,
/manifest.webmanifest and /opengraph-image all generate.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 19:16:40 +02:00
|
|
|
{ path: '/docs', priority: 0.8, changeFrequency: 'weekly' },
|
|
|
|
|
{ path: '/docs/concepts', priority: 0.7, changeFrequency: 'monthly' },
|
|
|
|
|
{ path: '/docs/oauth', priority: 0.7, changeFrequency: 'monthly' },
|
|
|
|
|
{ path: '/docs/authoring', priority: 0.7, changeFrequency: 'monthly' },
|
|
|
|
|
{ path: '/docs/api-reference', priority: 0.7, changeFrequency: 'monthly' },
|
|
|
|
|
{ path: '/docs/self-hosting', priority: 0.7, changeFrequency: 'monthly' },
|
|
|
|
|
{ path: '/docs/faq', priority: 0.6, changeFrequency: 'monthly' },
|
|
|
|
|
{ path: '/changelog', priority: 0.6, changeFrequency: 'weekly' },
|
|
|
|
|
{ path: '/security', priority: 0.5, changeFrequency: 'monthly' },
|
|
|
|
|
{ path: '/status', priority: 0.4, changeFrequency: 'weekly' },
|
|
|
|
|
{ path: '/privacy', priority: 0.3, changeFrequency: 'yearly' },
|
|
|
|
|
{ path: '/terms', priority: 0.3, changeFrequency: 'yearly' },
|
|
|
|
|
];
|
|
|
|
|
|
2026-05-31 12:08:05 +02:00
|
|
|
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
feat(web): full SEO stack — metadata, JSON-LD, sitemap, robots, OG image
Ported and adapted from the BuildMyDiscord SEO setup:
- lib/seo.ts — single source for site constants, the FAQ data (shared by
the rendered FAQ and the FAQPage schema so they never drift) and JSON-LD
builders.
- Rich root metadata: title template, keywords, Open Graph, Twitter card,
robots directives, canonical.
- JSON-LD: Organization + WebSite + SoftwareApplication sitewide, FAQPage
on the landing page. No AggregateRating — there are no real reviews yet.
- app/robots.ts — allow all, explicit allow-list for AI answer-engine
crawlers (GPTBot, ClaudeBot, PerplexityBot, …), disallow private routes.
- app/sitemap.ts — every public marketing + docs route.
- app/opengraph-image.tsx — monochrome on-brand 1200x630 share card.
- app/manifest.ts + public/llms.txt.
- Per-page metadata for pricing, changelog, security, privacy, terms,
docs, templates and status.
- opengraph-image + apple-icon pinned to the edge runtime — next/og
crashes during a Node-runtime prerender.
Verified: next build passes; /robots.txt, /sitemap.xml,
/manifest.webmanifest and /opengraph-image all generate.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 19:16:40 +02:00
|
|
|
const now = new Date();
|
2026-05-31 12:08:05 +02:00
|
|
|
const staticEntries: MetadataRoute.Sitemap = ROUTES.map((r) => ({
|
feat(web): full SEO stack — metadata, JSON-LD, sitemap, robots, OG image
Ported and adapted from the BuildMyDiscord SEO setup:
- lib/seo.ts — single source for site constants, the FAQ data (shared by
the rendered FAQ and the FAQPage schema so they never drift) and JSON-LD
builders.
- Rich root metadata: title template, keywords, Open Graph, Twitter card,
robots directives, canonical.
- JSON-LD: Organization + WebSite + SoftwareApplication sitewide, FAQPage
on the landing page. No AggregateRating — there are no real reviews yet.
- app/robots.ts — allow all, explicit allow-list for AI answer-engine
crawlers (GPTBot, ClaudeBot, PerplexityBot, …), disallow private routes.
- app/sitemap.ts — every public marketing + docs route.
- app/opengraph-image.tsx — monochrome on-brand 1200x630 share card.
- app/manifest.ts + public/llms.txt.
- Per-page metadata for pricing, changelog, security, privacy, terms,
docs, templates and status.
- opengraph-image + apple-icon pinned to the edge runtime — next/og
crashes during a Node-runtime prerender.
Verified: next build passes; /robots.txt, /sitemap.xml,
/manifest.webmanifest and /opengraph-image all generate.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 19:16:40 +02:00
|
|
|
url: `${SITE_URL}${r.path}`,
|
|
|
|
|
lastModified: now,
|
|
|
|
|
changeFrequency: r.changeFrequency,
|
|
|
|
|
priority: r.priority,
|
|
|
|
|
}));
|
2026-05-31 12:08:05 +02:00
|
|
|
|
|
|
|
|
// Marketplace templates — each public template is its own indexable page.
|
|
|
|
|
// Best-effort: if the API is unreachable the static entries still ship.
|
|
|
|
|
const slugs = await fetchPublicTemplateSlugs();
|
|
|
|
|
const templateEntries: MetadataRoute.Sitemap = slugs.map((slug) => ({
|
|
|
|
|
url: `${SITE_URL}/templates/${slug}`,
|
|
|
|
|
lastModified: now,
|
|
|
|
|
changeFrequency: 'weekly',
|
|
|
|
|
priority: 0.6,
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
return [...staticEntries, ...templateEntries];
|
feat(web): full SEO stack — metadata, JSON-LD, sitemap, robots, OG image
Ported and adapted from the BuildMyDiscord SEO setup:
- lib/seo.ts — single source for site constants, the FAQ data (shared by
the rendered FAQ and the FAQPage schema so they never drift) and JSON-LD
builders.
- Rich root metadata: title template, keywords, Open Graph, Twitter card,
robots directives, canonical.
- JSON-LD: Organization + WebSite + SoftwareApplication sitewide, FAQPage
on the landing page. No AggregateRating — there are no real reviews yet.
- app/robots.ts — allow all, explicit allow-list for AI answer-engine
crawlers (GPTBot, ClaudeBot, PerplexityBot, …), disallow private routes.
- app/sitemap.ts — every public marketing + docs route.
- app/opengraph-image.tsx — monochrome on-brand 1200x630 share card.
- app/manifest.ts + public/llms.txt.
- Per-page metadata for pricing, changelog, security, privacy, terms,
docs, templates and status.
- opengraph-image + apple-icon pinned to the edge runtime — next/og
crashes during a Node-runtime prerender.
Verified: next build passes; /robots.txt, /sitemap.xml,
/manifest.webmanifest and /opengraph-image all generate.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 19:16:40 +02:00
|
|
|
}
|