Keep listed published rules public and guest-claim rules unlisted, with semantic document markup and share chrome that stays clickable.

Guest publishes remain share-by-link but stay out of the catalog and sitemap, and their pages send noindex until claimed. The published-rule view now uses heading and list markup matching Markdown export, and top banners sit below the header so Share is not covered.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
adilalloandCursor committed 2026-09-17 17:42:01 -06:00
1 parent 77b0ec8ad8
commit 1445cb7e1e
27 files changed
+524 -86

No files matched your search

+13 -4
View File
@@ -17,11 +17,13 @@ const STATIC_PUBLIC_PATHS = [
] as const;
/**
* Public marketing URLs for `/sitemap.xml`. Omits signed-in product routes
* (`/create`, `/login`, `/profile`), admin, and `/rules/[id]` (those ids are
* not known without the database).
* Public marketing URLs for `/sitemap.xml`, plus listed published rules when
* the caller supplies them. Omits signed-in product routes (`/create`,
* `/login`, `/profile`), admin, and unlisted guest-claim `/rules/[id]`.
*/
export function buildPublicSitemap(): MetadataRoute.Sitemap {
export function buildPublicSitemap(
listedRules: ReadonlyArray<{ id: string; updatedAt: Date }> = [],
): MetadataRoute.Sitemap {
const entries: MetadataRoute.Sitemap = STATIC_PUBLIC_PATHS.map((path) => ({
url: sitemapUrl(path),
}));
@@ -38,5 +40,12 @@ export function buildPublicSitemap(): MetadataRoute.Sitemap {
entries.push({ url: sitemapUrl(`/use-cases/${slug}/rule`) });
}
for (const rule of listedRules) {
entries.push({
url: sitemapUrl(`/rules/${encodeURIComponent(rule.id)}`),
lastModified: rule.updatedAt,
});
}
return entries;
}