Shumiland/src/collections/BlogPosts.ts
Vadym Samoilenko 7ee5e8a434
Some checks are pending
CI / Type Check (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Unit Tests (push) Waiting to run
Deploy / Build & Push Image (push) Waiting to run
Deploy / Deploy to VPS (push) Blocked by required conditions
feat(ui): card stack slider, footer redesign, video glow, revalidation fix
UI changes:
- Locations section: replace 3D coverflow with draggable card stack (framer-motion), auto-advance 4s, dot navigation
- Footer: orange gradient matching header, dark green text for readability
- VideoSection: orange box-shadow glow around video block, green wave pattern preserved

Bug fixes:
- fix(revalidate): SECRET empty check was blocking all CMS cache invalidations on prod
- fix(revalidate): location pages now revalidate /lokatsii/{slug} + /lokatsii + layout
- fix(revalidate): blog posts revalidate /blog/{slug} + /blog
- fix(pages): add dynamicParams=true to /[slug] and /lokatsii/[slug] for post-build new entries
- fix(lokatsii): dynamic DETAIL_HREF — new locations with showDetailPage:true auto-get detail button
- fix(combo): cursor:pointer on combo ticket cards
- fix(blog): add EXPERIMENTAL_TableFeature to Lexical editor

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04 12:18:01 +01:00

62 lines
1.9 KiB
TypeScript

import type { CollectionConfig } from 'payload'
import { lexicalEditor, EXPERIMENTAL_TableFeature } from '@payloadcms/richtext-lexical'
import { isAdminOrEditor } from '@/access/isAdminOrEditor'
import { isAuthenticatedOrPublished } from '@/access/isAuthenticatedOrPublished'
import { slugifyBeforeChange } from '@/hooks/slugify'
import { revalidateAfterChange } from '@/hooks/revalidatePath'
export const BlogPosts: CollectionConfig = {
slug: 'blog-posts',
admin: {
useAsTitle: 'title',
defaultColumns: ['title', 'slug', 'status', 'publishedAt', 'updatedAt'],
group: 'Блог',
},
versions: { drafts: true },
access: {
read: isAuthenticatedOrPublished,
create: isAdminOrEditor,
update: isAdminOrEditor,
delete: isAdminOrEditor,
},
hooks: {
beforeChange: [slugifyBeforeChange],
afterChange: [revalidateAfterChange],
},
fields: [
{ name: 'title', type: 'text', required: true },
{
name: 'slug',
type: 'text',
unique: true,
index: true,
admin: { readOnly: true, position: 'sidebar' },
},
{
name: 'publishedAt',
type: 'date',
admin: { position: 'sidebar', date: { pickerAppearance: 'dayAndTime' } },
},
{ name: 'hero', type: 'upload', relationTo: 'media' },
{
name: 'body',
type: 'richText',
editor: lexicalEditor({
features: ({ defaultFeatures }) => [...defaultFeatures, EXPERIMENTAL_TableFeature()],
}),
},
{ name: 'excerpt', type: 'textarea' },
{ name: 'categories', type: 'relationship', relationTo: 'categories', hasMany: true },
{ name: 'tags', type: 'relationship', relationTo: 'tags', hasMany: true },
{
name: 'status',
type: 'select',
defaultValue: 'draft',
options: [
{ label: 'Draft', value: 'draft' },
{ label: 'Published', value: 'published' },
],
admin: { position: 'sidebar' },
},
],
}