teqo-backup/next.config.mjs
Francisco Solla 100242037a feat(site): vira o site público para o mandato pós-eleição (S47)
Home abre no agradecimento pelos 152.049 votos com board 1+3, trajetória, bandeiras do mandato, galeria de fotos e rodapé institucional; chrome novo (header home/interno, lockup de nome, menu mobile acessível) e /artigos//fotos com título compacto.

As superfícies de campanha saem do ar (308 de /conteudos, /jingles e /cards), junto com newsletter, estúdio público de cards e UI da Central/jingles; download de foto e .ics perdem o 1313. Sem migration, sem Consent novo e sem apagar dados do CMS.
2026-10-22 01:34:09 -03:00

47 lines
2.4 KiB
JavaScript

import { withPayload } from '@payloadcms/next/withPayload'
/** @type {import('next').NextConfig} */
const allowedImageHost = process.env.NEXT_PUBLIC_SITE_URL || 'https://jorgesolla.com.br'
const nextConfig = {
distDir: process.env.NEXT_DIST_DIR || '.next',
...(process.env.NEXT_OUTPUT_STANDALONE === '1' ? { output: 'standalone' } : {}),
// S47 — the campaign surfaces left the air after the election. The pages are
// gone from the tree; the permanent redirects keep the links that already
// circulated (and any index entry) pointing at the mandate instead of a 404.
async redirects() {
return [
{ source: '/conteudos', destination: '/artigos', permanent: true },
{ source: '/conteudos/:path*', destination: '/artigos', permanent: true },
{ source: '/jingles', destination: '/', permanent: true },
{ source: '/jingles/:path*', destination: '/', permanent: true },
{ source: '/cards', destination: '/', permanent: true },
{ source: '/cards/:path*', destination: '/', permanent: true },
]
},
images: {
minimumCacheTTL: 14400,
remotePatterns: [
new URL(`${allowedImageHost}/**`),
// YouTube video thumbnails (campaign home content board, S2) come from
// the platform's CDN — see `src/utilities/socialFeed/youtubeFeed.ts`.
new URL('https://i.ytimg.com/**'),
// Instagram media thumbnails (campaign home content board, S3) come from
// the Graph API's CDN (hosts vary per region) —
// see `src/utilities/socialFeed/instagramFeed.ts`. Plain objects (not
// `new URL`) on purpose: the URL form pins `search: ''`, and Graph API
// media URLs carry a signed query string — the optimizer would reject
// them with 400 even on an allowed host.
{ protocol: 'https', hostname: '*.cdninstagram.com', pathname: '/**' },
// Meta moved Instagram Graph API media to `*.fbcdn.net`
// (`instagram.<pop>.fna.fbcdn.net`, `scontent.<pop>.fna.fbcdn.net`) —
// without this the optimizer answers 400 and every IG cover breaks.
{ protocol: 'https', hostname: '**.fbcdn.net', pathname: '/**' },
// e2e-only: the YouTube/Instagram stubs (tests/e2e/*-stub.mjs) serve the
// fixture thumbnails locally so specs never touch the real network.
{ protocol: 'http', hostname: 'localhost', pathname: '/thumbs/**' },
],
},
}
export default withPayload(nextConfig, { devBundleServerPackages: false })