Skip to content

Commit d51d2a4

Browse files
Merge pull request #72 from dharunashokkumar/main
fix: sitemap coverage and legal page SEO (#69)
2 parents 7edc577 + 5d5a148 commit d51d2a4

7 files changed

Lines changed: 53 additions & 2 deletions

File tree

src/app/cookies/page.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
import type { Metadata } from 'next';
2+
3+
import { buildBrowseMetadata } from '@/features/browse/lib/seo';
14
import { LegalPage } from '@/features/legal/components/LegalPage';
25
import { OpenCookiePreferencesButton } from '@/shared/components/privacy/OpenCookiePreferencesButton';
36

7+
export const metadata: Metadata = buildBrowseMetadata({
8+
title: 'Cookie Policy',
9+
description: 'What storage Conflicts.app uses, which categories are necessary, and how to manage consent.',
10+
path: '/cookies',
11+
});
12+
413
export default function CookiesPage() {
514
return (
615
<LegalPage

src/app/privacy/page.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
import type { Metadata } from 'next';
2+
3+
import { buildBrowseMetadata } from '@/features/browse/lib/seo';
14
import { LegalPage } from '@/features/legal/components/LegalPage';
25

6+
export const metadata: Metadata = buildBrowseMetadata({
7+
title: 'Privacy Policy',
8+
description: 'How Conflicts.app handles analytics, chat continuity, and local device storage.',
9+
path: '/privacy',
10+
});
11+
312
export default function PrivacyPage() {
413
return (
514
<LegalPage

src/app/sitemap.xml/route.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export function GET() {
55
renderSitemapIndex([
66
{ url: toAbsoluteUrl(SITEMAP_PATHS.browse) },
77
{ url: toAbsoluteUrl(SITEMAP_PATHS.dashboard) },
8+
{ url: toAbsoluteUrl(SITEMAP_PATHS.legal) },
89
{ url: toAbsoluteUrl(SITEMAP_PATHS.events) },
910
{ url: toAbsoluteUrl(SITEMAP_PATHS.actors) },
1011
{ url: toAbsoluteUrl(SITEMAP_PATHS.briefs) },

src/app/sitemaps/briefs.xml/route.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { createXmlResponse, renderSitemap, toAbsoluteUrl } from '@/features/browse/lib/sitemap';
22

33
import { publicConflictId } from '@/shared/lib/env';
4-
import { fmtDate } from '@/shared/lib/format';
54
import { prisma } from '@/server/lib/db';
65

76
const CONFLICT_ID = publicConflictId;
@@ -16,7 +15,7 @@ export async function GET() {
1615
return createXmlResponse(
1716
renderSitemap(
1817
briefs.map((brief) => ({
19-
url: toAbsoluteUrl(`/browse/brief/${fmtDate(brief.day.toISOString())}`),
18+
url: toAbsoluteUrl(`/browse/brief/${brief.day.toISOString().slice(0, 10)}`),
2019
lastModified: brief.updatedAt,
2120
})),
2221
),
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { createXmlResponse, LEGAL_ROUTES, renderSitemap, toAbsoluteUrl } from '@/features/browse/lib/sitemap';
2+
3+
export function GET() {
4+
return createXmlResponse(
5+
renderSitemap(LEGAL_ROUTES.map((path) => ({ url: toAbsoluteUrl(path) }))),
6+
);
7+
}

src/app/terms/page.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
import type { Metadata } from 'next';
2+
3+
import { buildBrowseMetadata } from '@/features/browse/lib/seo';
14
import { LegalPage } from '@/features/legal/components/LegalPage';
25

6+
export const metadata: Metadata = buildBrowseMetadata({
7+
title: 'Terms of Use',
8+
description: 'Baseline terms for using Conflicts.app, its public intelligence views, and the open-source product.',
9+
path: '/terms',
10+
});
11+
312
export default function TermsPage() {
413
return (
514
<LegalPage

src/features/browse/lib/sitemap.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,29 @@ export const DASHBOARD_ROUTES = [
2323
'/dashboard',
2424
'/dashboard/map',
2525
'/dashboard/signals',
26+
'/dashboard/feed',
27+
'/dashboard/actors',
28+
'/dashboard/brief',
29+
'/dashboard/predictions',
30+
'/dashboard/data',
31+
'/dashboard/data/news',
32+
'/dashboard/data/news/timeline',
33+
'/dashboard/data/perspectives',
34+
'/dashboard/data/predictions',
35+
'/dashboard/data/economics',
36+
] as const;
37+
38+
export const LEGAL_ROUTES = [
39+
'/privacy',
40+
'/cookies',
41+
'/terms',
2642
] as const;
2743

2844
export const SITEMAP_PATHS = {
2945
index: '/sitemap.xml',
3046
browse: '/sitemaps/browse.xml',
3147
dashboard: '/sitemaps/dashboard.xml',
48+
legal: '/sitemaps/legal.xml',
3249
events: '/sitemaps/events.xml',
3350
actors: '/sitemaps/actors.xml',
3451
briefs: '/sitemaps/briefs.xml',

0 commit comments

Comments
 (0)