Reference site: Example Studio on ipal-kit (reference/), index for agents, CI job
reference/ is one complete client site on the plugin (made-up company, pl/en, MongoDB, every library block and template, token standard light/dark, forms, consent, SEO/GEO, enforced CSP, 2FA, base + demo seeds, Coolify runbook, smoke tests). It uses the plugin as file:.. (injected) and is not shipped. - docs/agent/reference-site/INDEX.md (generated by scripts/reference-index.mjs, kept current by test/referenceIndex.test.ts) - AGENT.md section and pointers in ipal-site, ipal-setup, ipal-reference, ipal-upgrade, ipal-block; release steps in PROGRAMISTA §8.1b - CI: reference (fast) on every push, reference-full on main; doctor steps wired, commented until ipal-doctor ships Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8bb5ebd394
commit
8adac41f92
@@ -0,0 +1,21 @@
|
||||
import type { CollectionConfig } from 'payload'
|
||||
|
||||
import { buildRevalidateHook } from '@intecion/ipal-kit'
|
||||
import { revalidatePath } from 'next/cache'
|
||||
|
||||
import { i18nConfig } from '@/i18n.config'
|
||||
|
||||
import { entryFields } from './entryFields'
|
||||
|
||||
const revalidate = buildRevalidateHook({ config: i18nConfig, revalidatePath })
|
||||
|
||||
/** The project's own archive collection (skill ipal-collection) — the library has no case-study type. */
|
||||
export const CaseStudies: CollectionConfig = {
|
||||
slug: 'caseStudies',
|
||||
admin: { defaultColumns: ['title', 'publishedAt', 'updatedAt'], useAsTitle: 'title' },
|
||||
access: { read: () => true },
|
||||
defaultSort: '-publishedAt',
|
||||
fields: entryFields,
|
||||
hooks: { afterChange: [revalidate.afterChange], afterDelete: [revalidate.afterDelete] },
|
||||
labels: { plural: { en: 'Case studies', pl: 'Realizacje' }, singular: { en: 'Case study', pl: 'Realizacja' } },
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import type { CollectionConfig } from 'payload'
|
||||
|
||||
import {
|
||||
buildMediaPlaceholderField,
|
||||
buildMediaPlaceholderHook,
|
||||
buildOptimizeUploadField,
|
||||
buildOptimizeUploadHook,
|
||||
normalizeFilenameHook,
|
||||
} from '@intecion/ipal-kit'
|
||||
|
||||
/** media.md "Full collection", 1:1. */
|
||||
export const Media: CollectionConfig = {
|
||||
slug: 'media',
|
||||
access: { read: () => true }, // public files; media are served by the app (/api/media/file/…)
|
||||
upload: { focalPoint: true, mimeTypes: ['image/*', 'application/pdf', 'video/mp4', 'video/webm'] },
|
||||
hooks: {
|
||||
beforeOperation: [normalizeFilenameHook, buildOptimizeUploadHook(), buildMediaPlaceholderHook()],
|
||||
},
|
||||
fields: [
|
||||
{ name: 'alt', type: 'text', localized: true, required: true },
|
||||
buildOptimizeUploadField(),
|
||||
buildMediaPlaceholderField(),
|
||||
],
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import type { CollectionConfig } from 'payload'
|
||||
|
||||
import {
|
||||
buildNoindexField,
|
||||
buildPreventDeleteSystemPage,
|
||||
buildRevalidateHook,
|
||||
buildSlugField,
|
||||
buildSummaryField,
|
||||
trackSlugHistoryHook,
|
||||
} from '@intecion/ipal-kit'
|
||||
import { revalidatePath } from 'next/cache'
|
||||
|
||||
import { pageBlocks } from '@/blocks/configs'
|
||||
import { i18nConfig } from '@/i18n.config'
|
||||
|
||||
const revalidate = buildRevalidateHook({ config: i18nConfig, revalidatePath })
|
||||
|
||||
export const Pages: CollectionConfig = {
|
||||
slug: 'pages',
|
||||
admin: { defaultColumns: ['title', 'slug', 'updatedAt'], useAsTitle: 'title' },
|
||||
access: { read: () => true },
|
||||
fields: [
|
||||
{ name: 'title', type: 'text', localized: true, required: true },
|
||||
buildSlugField({ from: 'title' }),
|
||||
{ name: 'layout', type: 'blocks', blocks: pageBlocks, minRows: 1 },
|
||||
buildSummaryField(), // aiSummary — GEO (llms.txt, MCP)
|
||||
buildNoindexField(),
|
||||
{ name: 'slugHistory', type: 'array', admin: { readOnly: true }, fields: [{ name: 'slug', type: 'text' }] },
|
||||
],
|
||||
hooks: {
|
||||
afterChange: [revalidate.afterChange],
|
||||
afterDelete: [revalidate.afterDelete],
|
||||
beforeChange: [trackSlugHistoryHook],
|
||||
beforeDelete: [buildPreventDeleteSystemPage({ settingsSlug: 'site-settings' })],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import type { CollectionConfig } from 'payload'
|
||||
|
||||
import { buildRevalidateHook } from '@intecion/ipal-kit'
|
||||
import { revalidatePath } from 'next/cache'
|
||||
|
||||
import { i18nConfig } from '@/i18n.config'
|
||||
|
||||
import { entryFields } from './entryFields'
|
||||
|
||||
const revalidate = buildRevalidateHook({ config: i18nConfig, revalidatePath })
|
||||
|
||||
/** Blog entries — listed on the page assigned in Site settings → System pages → Blog (content.config.ts). */
|
||||
export const Posts: CollectionConfig = {
|
||||
slug: 'posts',
|
||||
admin: { defaultColumns: ['title', 'publishedAt', 'updatedAt'], useAsTitle: 'title' },
|
||||
access: { read: () => true },
|
||||
defaultSort: '-publishedAt',
|
||||
fields: entryFields,
|
||||
hooks: { afterChange: [revalidate.afterChange], afterDelete: [revalidate.afterDelete] },
|
||||
labels: { plural: { en: 'Blog posts', pl: 'Wpisy' }, singular: { en: 'Blog post', pl: 'Wpis' } },
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import type { Field } from 'payload'
|
||||
|
||||
import { buildNoindexField, buildSlugField, buildSummaryField } from '@intecion/ipal-kit'
|
||||
|
||||
import { pageBlocks } from '@/blocks/configs'
|
||||
|
||||
/**
|
||||
* Fields every archive collection shares (posts, case studies). The entry card of the entry list block
|
||||
* reads `title`, `excerpt`, `media` and `publishedAt` (defaultEntryCard), so the names follow it.
|
||||
*/
|
||||
export const entryFields: Field[] = [
|
||||
{ name: 'title', type: 'text', localized: true, required: true },
|
||||
buildSlugField({ from: 'title' }),
|
||||
{ name: 'excerpt', type: 'textarea', localized: true, admin: { description: 'One or two sentences on the card in lists.' } },
|
||||
{ name: 'media', type: 'upload', relationTo: 'media', admin: { description: 'Card and share image.' } },
|
||||
{ name: 'publishedAt', type: 'date', admin: { position: 'sidebar' }, defaultValue: () => new Date().toISOString() },
|
||||
{ name: 'layout', type: 'blocks', blocks: pageBlocks },
|
||||
buildSummaryField(),
|
||||
buildNoindexField(),
|
||||
]
|
||||
Reference in New Issue
Block a user