Files
trumpsignal-frontend/app/sitemap.ts
T
k f34ae9eb00 feat(macro-vibes): rename BTC Signal → Macro Vibes; add MacroPanel UI
Module rename across page H1, navbar tab, URL (/en/btc → /en/macro),
all metadata/JSON-LD, sitemap, llms.txt, opengraph image, and SystemControl
copy. Old /btc route fully removed.

New components/btc/MacroPanel.tsx polls /api/macro/snapshot and lays out
the 8 indicators in four sections (Valuation / Bottom trigger reference /
Market structure / Sentiment & flows / Positioning) with tone-coloured
values, current-band threshold chips, and a single CoinGlass / source
chart link per card. Composite -100..+100 needle pulses on score change.

Also fixes the pinned bottom-reversal alert on the homepage, which still
linked to the now-404 /en/btc — now routes to /en/macro.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 01:05:18 +08:00

66 lines
2.2 KiB
TypeScript

import type { MetadataRoute } from 'next'
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL
// In production, warn loudly but don't crash — the sitemap will use the
// fallback URL. Set NEXT_PUBLIC_SITE_URL in your deployment env to get the
// correct absolute URLs in sitemap.xml.
if (!siteUrl && process.env.NODE_ENV === 'production') {
console.warn(
'[sitemap] NEXT_PUBLIC_SITE_URL is not set — sitemap will use https://trumpsignal.com as fallback. ' +
'Set this env var in your deployment to avoid incorrect sitemap URLs.',
)
}
const base = (siteUrl || 'https://trumpsignal.com').replace(/\/$/, '')
const routes: Array<{
path: string
priority: number
freq: MetadataRoute.Sitemap[number]['changeFrequency']
}> = [
{ path: '', priority: 1.0, freq: 'hourly' },
{ path: '/trump', priority: 0.9, freq: 'hourly' },
{ path: '/macro', priority: 0.9, freq: 'daily' },
{ path: '/kol', priority: 0.9, freq: 'daily' },
{ path: '/trades', priority: 0.8, freq: 'daily' },
{ path: '/analytics', priority: 0.7, freq: 'daily' },
{ path: '/methodology', priority: 0.8, freq: 'monthly' },
{ path: '/glossary', priority: 0.8, freq: 'monthly' },
{ path: '/case-studies', priority: 0.8, freq: 'monthly' },
{ path: '/settings', priority: 0.5, freq: 'monthly' },
{ path: '/privacy', priority: 0.3, freq: 'yearly' },
{ path: '/terms', priority: 0.3, freq: 'yearly' },
{ path: '/contact', priority: 0.4, freq: 'monthly' },
]
// i18n shelved — only emit English routes. Add 'zh' back when content is
// actually translated (otherwise Google flags duplicate content under hreflang).
const locales = ['en']
export default function sitemap(): MetadataRoute.Sitemap {
const now = new Date()
const entries: MetadataRoute.Sitemap = []
// Root landing (not locale-scoped)
entries.push({
url: base,
lastModified: now,
changeFrequency: 'hourly',
priority: 1.0,
})
for (const locale of locales) {
for (const r of routes) {
entries.push({
url: `${base}/${locale}${r.path}`,
lastModified: now,
changeFrequency: r.freq,
priority: r.priority,
})
}
}
return entries
}