From f8bd75813cf23baa49f0c98bbca0dd649a655ca1 Mon Sep 17 00:00:00 2001 From: Joshua <62268199+minimalsm@users.noreply.github.com> Date: Sun, 15 Feb 2026 17:27:36 +0000 Subject: [PATCH 1/2] fix(sitemap): include dynamic route pages and remove stale entries Adds pages from dynamic routes (app detail pages, app category pages) to the sitemap. Removes entries for pages that canonicalize elsewhere. Also includes the root homepage URL. --- app/sitemap.ts | 52 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/app/sitemap.ts b/app/sitemap.ts index 8e24caf7124..e36a11a356d 100644 --- a/app/sitemap.ts +++ b/app/sitemap.ts @@ -1,19 +1,36 @@ import type { MetadataRoute } from "next" -import { getFullUrl } from "@/lib/utils/url" +import { getFullUrl, slugify } from "@/lib/utils/url" -import { DEFAULT_LOCALE } from "@/lib/constants" +import { DEFAULT_LOCALE, SITE_URL } from "@/lib/constants" + +import { appsCategories } from "@/data/apps/categories" import { getAllPagesWithTranslations } from "@/lib/i18n/translationRegistry" +import { getAppsData } from "@/lib/data" + +// Slugs that canonicalize elsewhere and should not appear in the sitemap +const EXCLUDED_SLUGS = ["/developers/tutorials/ipfs-decentralized-ui/"] + export default async function sitemap(): Promise { const pages = await getAllPagesWithTranslations() - const entries: MetadataRoute.Sitemap = [] + const entries: MetadataRoute.Sitemap = [ + { + url: `${SITE_URL}/`, + changeFrequency: "daily", + priority: 1.0, + lastModified: new Date(), + }, + ] for (const { slug, translatedLocales } of pages) { const normalizedSlug = slug.startsWith("/") ? slug : `/${slug}` + // Skip excluded slugs + if (EXCLUDED_SLUGS.includes(normalizedSlug)) continue + for (const locale of translatedLocales) { const url = getFullUrl(locale, normalizedSlug) @@ -37,5 +54,34 @@ export default async function sitemap(): Promise { } } + // Add app category pages + for (const category of Object.values(appsCategories)) { + entries.push({ + url: `${SITE_URL}/apps/categories/${category.slug}/`, + changeFrequency: "weekly", + priority: 0.6, + lastModified: new Date(), + }) + } + + // Add individual app pages + const appsData = await getAppsData() + if (appsData) { + const appSlugs = new Set() + for (const apps of Object.values(appsData)) { + for (const app of apps) { + appSlugs.add(slugify(app.name)) + } + } + for (const slug of appSlugs) { + entries.push({ + url: `${SITE_URL}/apps/${slug}/`, + changeFrequency: "monthly", + priority: 0.5, + lastModified: new Date(), + }) + } + } + return entries } From f492d3554f084108c41b44566e3b1c306e34f35f Mon Sep 17 00:00:00 2001 From: Joshua <62268199+minimalsm@users.noreply.github.com> Date: Sun, 15 Feb 2026 18:01:21 +0000 Subject: [PATCH 2/2] fix(sitemap): also include developer tools category pages Adds /developers/tools/[category] pages (education, sdks, contracts, security, etc.) which were also excluded by the dynamic route filter. --- app/sitemap.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/sitemap.ts b/app/sitemap.ts index e36a11a356d..2f8243ca07e 100644 --- a/app/sitemap.ts +++ b/app/sitemap.ts @@ -5,6 +5,7 @@ import { getFullUrl, slugify } from "@/lib/utils/url" import { DEFAULT_LOCALE, SITE_URL } from "@/lib/constants" import { appsCategories } from "@/data/apps/categories" +import { DEV_TOOL_CATEGORIES } from "./[locale]/developers/tools/constants" import { getAllPagesWithTranslations } from "@/lib/i18n/translationRegistry" @@ -64,6 +65,16 @@ export default async function sitemap(): Promise { }) } + // Add developer tools category pages (dynamic route: /developers/tools/[category]) + for (const { slug } of DEV_TOOL_CATEGORIES) { + entries.push({ + url: `${SITE_URL}/developers/tools/${slug}/`, + changeFrequency: "monthly", + priority: 0.6, + lastModified: new Date(), + }) + } + // Add individual app pages const appsData = await getAppsData() if (appsData) {