init commit for iPAL-kit plugin

This commit is contained in:
2026-07-18 20:30:23 +02:00
parent 10638127a9
commit 5733a9c8bf
119 changed files with 6892 additions and 411 deletions
@@ -0,0 +1,68 @@
import type { Field } from 'payload'
/**
* General site identity fields.
* Consumed by SEO/OG (siteName, defaultShareImage) and frontend (logo).
*/
export const generalFields: Field[] = [
{
name: 'siteName',
type: 'text',
admin: {
description: 'Used in page titles and Open Graph metadata.',
},
localized: true,
required: true,
},
{
name: 'titleOrder',
type: 'select',
admin: {
description: 'Which comes first in browser tabs.',
},
defaultValue: 'page-first',
options: [
{ label: 'Page first — About Us | Acme', value: 'page-first' },
{ label: 'Site first — Acme | About Us', value: 'site-first' },
],
},
{
name: 'titleSeparator',
type: 'select',
admin: {
description: 'Separates the page title from the site name in browser tabs.',
},
defaultValue: '|',
options: [
{ label: 'Pipe — Page | Site', value: '|' },
{ label: 'Dash — Page – Site', value: '–' },
{ label: 'Hyphen — Page - Site', value: '-' },
{ label: 'Bullet — Page · Site', value: '·' },
{ label: 'Slash — Page / Site', value: '/' },
],
},
{
name: 'logo',
type: 'upload',
admin: {
description: 'Primary site logo.',
},
relationTo: 'media',
},
{
name: 'defaultShareImage',
type: 'upload',
admin: {
description: 'Fallback Open Graph image when a page has none.',
},
relationTo: 'media',
},
{
name: 'favicon',
type: 'upload',
admin: {
description: 'Square source icon (PNG or SVG) for the browser tab. Rendered by the frontend.',
},
relationTo: 'media',
},
]
+32
View File
@@ -0,0 +1,32 @@
import type { Field } from 'payload'
/**
* Theme behavior configuration.
*
* These are decisions, not visuals — the plugin stores them, the client
* template reads them and decides whether to render a toggle and which
* mode to start in. Appearance itself stays in the template.
*/
export const themeFields: Field[] = [
{
name: 'defaultTheme',
type: 'select',
admin: {
description: 'Theme applied on a visitor’s first visit.',
},
defaultValue: 'light',
options: [
{ label: 'Light', value: 'light' },
{ label: 'Dark', value: 'dark' },
],
required: true,
},
{
name: 'allowThemeToggle',
type: 'checkbox',
admin: {
description: 'Show a light/dark switch on the site.',
},
defaultValue: true,
},
]