feat: prepare CMS pages for deployment

This commit is contained in:
Codex
2026-04-29 14:23:00 +08:00
parent 9a55b874a5
commit d4fb7e0973
87 changed files with 5153 additions and 1901 deletions
@@ -4,12 +4,13 @@ import { revalidatePath } from 'next/cache'
import { redirect } from 'next/navigation'
const CACHE_PATHS = [
'/sitemap.xml',
'/en',
'/zh',
'/en/about',
'/zh/about',
'/en/dealers',
'/zh/dealers',
'/en/where-to-buy',
'/zh/where-to-buy',
'/en/downloads',
'/zh/downloads',
'/en/news',
@@ -54,3 +55,11 @@ export async function clearFrontendCache(formData: FormData) {
redirect(`${returnTo}${returnTo.includes('?') ? '&' : '?'}cache=cleared`)
}
export async function refreshSitemapCache(formData: FormData) {
const returnTo = normalizeReturnPath(formData.get('returnTo'))
revalidatePath('/sitemap.xml')
redirect(`${returnTo}${returnTo.includes('?') ? '&' : '?'}sitemap=refreshed`)
}