Gap fixes: top-level searchSettings, public shouldLoadGoogle, consent/stats collection overrides
- ipalKit({ searchSettings }): switches off / reshapes Site Settings → Search & AI
without `seo`; read as options.searchSettings ?? options.seo?.searchSettings.
- shouldLoadGoogle moved to a pure module (analytics/shouldLoadGoogle.ts) and
exported from @intecion/ipal-kit and /client.
- consentLog.collectionOverrides and stats.collectionOverrides (object merges
access/admin/hooks key by key, function takes over), via the new exported
applyCollectionOverride / CollectionOverride. The stats view and dashboard
chart now follow the stats-visits read access, so overrides narrow them too.
All additive; defaults unchanged. Docs: AGENT.md, ipal-reference, consent,
stats, seo, analytics, ipal-setup.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
4911da7112
commit
5a07c42f76
+7
-9
@@ -21,6 +21,7 @@ import { buildSystemPagesFields } from './modules/pages/index.js'
|
||||
import { buildSeoPlugin, injectAutoFillMeta, injectSeoTabs } from './modules/seo/index.js'
|
||||
import { buildIndexNowHook } from './modules/seo/indexNow.js'
|
||||
import { searchSettingsFields } from './modules/seo/searchSettings.js'
|
||||
import { applyCollectionOverride } from './modules/shared/collectionOverride.js'
|
||||
import { buildStatsCollection, buildStatsEndpoint } from './modules/stats/index.js'
|
||||
|
||||
/**
|
||||
@@ -277,19 +278,16 @@ export const ipalKit = (options: IpalOptions): Plugin => {
|
||||
: []),
|
||||
]
|
||||
|
||||
// Top-level option first (works without `seo`), then the older seo.searchSettings.
|
||||
const searchSettings = options.searchSettings ?? options.seo?.searchSettings
|
||||
const pluginGlobals = [
|
||||
buildSiteSettings({
|
||||
additionalFields: options.siteSettingsFields,
|
||||
...(options.pages ? { constructionFields: buildConstructionFields(options.pages.slug) } : {}),
|
||||
...(options.forms?.emailLayout ? { emailFields: emailSettingsFields } : {}),
|
||||
...(options.seo?.searchSettings === false
|
||||
...(searchSettings === false
|
||||
? {}
|
||||
: {
|
||||
searchFields:
|
||||
typeof options.seo?.searchSettings === 'function'
|
||||
? options.seo.searchSettings(searchSettingsFields)
|
||||
: searchSettingsFields,
|
||||
}),
|
||||
: { searchFields: typeof searchSettings === 'function' ? searchSettings(searchSettingsFields) : searchSettingsFields }),
|
||||
systemPageFields,
|
||||
}),
|
||||
buildSiteIntegrations({ additionalFields: options.integrationsFields }),
|
||||
@@ -309,7 +307,7 @@ export const ipalKit = (options: IpalOptions): Plugin => {
|
||||
// --- consent log: proof of consent (opt-in) ---
|
||||
if (options.consentLog) {
|
||||
const logOptions = options.consentLog === true ? {} : options.consentLog
|
||||
config.collections = [...(config.collections ?? []), buildConsentLogCollection()]
|
||||
config.collections = [...(config.collections ?? []), applyCollectionOverride(buildConsentLogCollection(), logOptions.collectionOverrides)]
|
||||
config.endpoints = [...(config.endpoints ?? []), buildConsentLogEndpoint(logOptions)]
|
||||
}
|
||||
|
||||
@@ -318,7 +316,7 @@ export const ipalKit = (options: IpalOptions): Plugin => {
|
||||
const statsOptions = options.stats === true ? {} : options.stats
|
||||
const adminRoute = options.adminRoute ?? '/admin'
|
||||
const viewProps = { adminRoute, ...(statsOptions.timeZone ? { timeZone: statsOptions.timeZone } : {}) }
|
||||
config.collections = [...(config.collections ?? []), buildStatsCollection()]
|
||||
config.collections = [...(config.collections ?? []), applyCollectionOverride(buildStatsCollection(), statsOptions.collectionOverrides)]
|
||||
config.endpoints = [...(config.endpoints ?? []), buildStatsEndpoint(statsOptions)]
|
||||
config.admin = {
|
||||
...(config.admin ?? {}),
|
||||
|
||||
Reference in New Issue
Block a user