teqo-backup/src/globals/HomePage.ts
Francisco Ignácio Fontoura Solla b955c48091 feat(cms): add homepage global and wire frontend to Payload content
- add  global () with required media upload field
- register new global in  and include it in admin live preview
- replace hardcoded frontend landing content with CMS-driven homepage image
- add typed cached utilities for globals/documents + centralized revalidation helpers
- migrate components to new global utility module and remove deprecated  helper
- update  revalidation hook to use shared global revalidation
- refine frontend layout/header and simplify legacy homepage CSS
- regenerate  for new global/schema changes
2026-02-15 16:19:57 -03:00

30 lines
567 B
TypeScript

import { revalidateGlobal } from '@/utilities/globals'
import { GlobalConfig } from 'payload'
const slug = 'home'
const revalidate = async () => revalidateGlobal(slug)
export const HomePage: GlobalConfig = {
slug,
label: 'Pagina Inicial',
admin: {
group: 'Paginas',
},
access: {
read: () => true,
update: ({ req: { user } }) => Boolean(user),
},
hooks: {
afterChange: [revalidate],
},
fields: [
{
name: 'image',
type: 'upload',
label: 'Imagem',
relationTo: 'media',
required: true,
},
],
}