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,102 @@
|
||||
import type { Seeder } from '@intecion/ipal-kit/seed'
|
||||
|
||||
import { libraryBlockSlugs } from '@intecion/ipal-kit/blocks'
|
||||
import { pageTemplates, systemPageRefs } from '@intecion/ipal-kit/templates'
|
||||
|
||||
import { blockOptions } from '@/blocks/configs'
|
||||
|
||||
import { pageLink, tx } from './lib'
|
||||
|
||||
/**
|
||||
* BASE layer — what every new site needs, kept by the project starter: the standard pages from the library
|
||||
* templates ([TO FILL] where only the client can write), system page roles, navigation, cookie banner texts,
|
||||
* the cookie list and the image viewer labels. Create-only: pages and fields the demo layer (or an editor)
|
||||
* already filled are skipped.
|
||||
*/
|
||||
const blocks = libraryBlockSlugs(blockOptions)
|
||||
|
||||
export async function seedBaseGlobals(seed: Seeder) {
|
||||
await seed.fillGlobal('company', { email: '[TO FILL: e-mail that receives form submissions]', name: '[TO FILL: company name]' })
|
||||
await seed.fillGlobal('site-settings', {
|
||||
allowThemeToggle: true,
|
||||
defaultTheme: 'system',
|
||||
siteName: '[TO FILL: site name]',
|
||||
themeToggleLabel: tx('Tryb ciemny', 'Dark mode'),
|
||||
})
|
||||
}
|
||||
|
||||
export async function seedBasePages(seed: Seeder) {
|
||||
await seed.upsertBySlug('pages', [
|
||||
pageTemplates.home({ blocks }),
|
||||
pageTemplates.about({ blocks }),
|
||||
pageTemplates.services({ blocks }),
|
||||
pageTemplates.contact({ blocks, form: { $form: 'Contact form' } }),
|
||||
// The archive page lists its entries with an entry list block (the editor decides where)
|
||||
pageTemplates.blogIndex({ blocks, layout: (b) => [b[0], { blockType: 'entryList', collection: 'posts', limit: 9, mode: 'latest', variant: 'cards' }, ...b.slice(1)] }),
|
||||
{ ...pageTemplates.legal('privacyPolicy', { blocks }), noindex: true },
|
||||
{ ...pageTemplates.legal('termsOfService', { blocks }), noindex: true },
|
||||
{ ...pageTemplates.cookiePolicy({ blocks }), noindex: true },
|
||||
pageTemplates.notFound({ blocks }),
|
||||
])
|
||||
}
|
||||
|
||||
export async function seedBaseNavigation(seed: Seeder) {
|
||||
const link = (label: { en: string; pl: string }, slug: string) => ({ link: { label, page: { $page: slug }, type: 'internal' } })
|
||||
await seed.fillGlobal('site-settings', {
|
||||
...systemPageRefs({ cookiePolicy: 'polityka-cookies', homepage: 'start', notFound: 'nie-znaleziono', privacyPolicy: 'polityka-prywatnosci', termsOfService: 'regulamin' }),
|
||||
postsArchive: { $page: 'blog' },
|
||||
})
|
||||
await seed.fillGlobal('header', {
|
||||
links: [pageLink(tx('Kontakt', 'Contact'), 'kontakt')],
|
||||
menuLabel: tx('Menu', 'Menu'),
|
||||
navItems: [link(tx('O nas', 'About'), 'o-nas'), link(tx('Usługi', 'Services'), 'uslugi'), link(tx('Blog', 'Blog'), 'blog'), link(tx('Kontakt', 'Contact'), 'kontakt')],
|
||||
})
|
||||
await seed.fillGlobal('footer', {
|
||||
columns: [{ heading: tx('Strona', 'Site'), items: [link(tx('O nas', 'About'), 'o-nas'), link(tx('Usługi', 'Services'), 'uslugi'), link(tx('Blog', 'Blog'), 'blog')] }],
|
||||
})
|
||||
}
|
||||
|
||||
/** Cookie banner and image viewer texts in both languages; the cookie list holds what the site itself sets. */
|
||||
export async function seedBaseTexts(seed: Seeder) {
|
||||
await seed.fillGlobal('cookie-settings', {
|
||||
alwaysActiveLabel: tx('Zawsze aktywne', 'Always active'),
|
||||
buttons: {
|
||||
acceptAll: tx('Akceptuj wszystkie', 'Accept all'),
|
||||
back: tx('Wstecz', 'Back'),
|
||||
close: tx('Zamknij', 'Close'),
|
||||
reject: tx('Odrzuć', 'Reject'),
|
||||
savePreferences: tx('Zapisz wybór', 'Save my choice'),
|
||||
settings: tx('Ustawienia', 'Settings'),
|
||||
},
|
||||
categories: [
|
||||
{ description: tx('Potrzebne, żeby strona działała: zapamiętują zgodę i język.', 'Needed for the site to work: they remember your consent and language.'), key: 'necessary', title: tx('Niezbędne', 'Necessary') },
|
||||
{ description: tx('Zapamiętują ustawienia, np. motyw jasny lub ciemny.', 'Remember settings such as the light or dark theme.'), key: 'functional', title: tx('Funkcjonalne', 'Functional') },
|
||||
{ description: tx('Pomagają zrozumieć, jak odwiedzający korzystają ze strony.', 'Help us understand how visitors use the site.'), key: 'analytics', title: tx('Analityczne', 'Analytics') },
|
||||
{ description: tx('Służą do mierzenia skuteczności reklam.', 'Used to measure how well ads work.'), key: 'marketing', title: tx('Marketingowe', 'Marketing') },
|
||||
],
|
||||
cookies: [
|
||||
{ category: 'necessary', duration: tx('12 miesięcy', '12 months'), name: 'cookie-consent', provider: tx('ta strona', 'this site'), purpose: tx('Zapamiętuje Twój wybór w sprawie cookies.', 'Remembers your cookie choice.'), storage: 'cookie' },
|
||||
{ category: 'necessary', duration: tx('12 miesięcy', '12 months'), name: 'NEXT_LOCALE', provider: tx('ta strona', 'this site'), purpose: tx('Zapamiętuje wybrany język.', 'Remembers the chosen language.'), storage: 'cookie' },
|
||||
{ category: 'functional', duration: tx('bez limitu', 'no expiry'), name: 'theme', provider: tx('ta strona', 'this site'), purpose: tx('Zapamiętuje motyw jasny lub ciemny.', 'Remembers the light or dark theme.'), storage: 'localStorage' },
|
||||
],
|
||||
detailLabels: { cookies: tx('Pliki cookies', 'Cookies'), duration: tx('Czas', 'Duration'), provider: tx('Dostawca', 'Provider'), purpose: tx('Cel', 'Purpose'), storage: tx('Rodzaj', 'Type') },
|
||||
message: tx(
|
||||
'Używamy niezbędnych plików cookies, żeby strona działała. Za Twoją zgodą użyjemy też cookies analitycznych.',
|
||||
'We use necessary cookies to make the site work. With your consent we also use analytics cookies.',
|
||||
),
|
||||
privacyLinkLabel: tx('Polityka prywatności', 'Privacy policy'),
|
||||
settingsDescription: tx('Wybierz, na które kategorie się zgadzasz. Zmienisz to w każdej chwili.', 'Choose which categories you agree to. You can change it at any time.'),
|
||||
settingsTitle: tx('Ustawienia cookies', 'Cookie settings'),
|
||||
title: tx('Szanujemy Twoją prywatność', 'We respect your privacy'),
|
||||
})
|
||||
await seed.fillGlobal('notifications', {
|
||||
lightbox: {
|
||||
close: tx('Zamknij', 'Close'),
|
||||
counter: tx('{current} / {total}', '{current} / {total}'),
|
||||
dialog: tx('Podgląd zdjęcia', 'Image viewer'),
|
||||
next: tx('Następne zdjęcie', 'Next image'),
|
||||
open: tx('Powiększ zdjęcie', 'Enlarge image'),
|
||||
previous: tx('Poprzednie zdjęcie', 'Previous image'),
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user