@foundrykit/seo-plugin 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activePlugins.d.ts +10 -0
- package/dist/activePlugins.js +27 -0
- package/dist/activePlugins.js.map +1 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Config } from 'payload';
|
|
2
|
+
/**
|
|
3
|
+
* Records this plugin as active in `config.custom.foundrykit.activePlugins`, the list
|
|
4
|
+
* `@foundrykit/guides-plugin` sends to the guides hub so the site gets this plugin's guides.
|
|
5
|
+
* Only call it on the enabled path: installed-but-disabled doesn't count.
|
|
6
|
+
*
|
|
7
|
+
* Every FoundryKit Payload plugin carries its own copy of this file (it's too small for a package);
|
|
8
|
+
* keep them identical.
|
|
9
|
+
*/
|
|
10
|
+
export declare const recordActivePlugin: (config: Config, name: string) => Config;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Records this plugin as active in `config.custom.foundrykit.activePlugins`, the list
|
|
3
|
+
* `@foundrykit/guides-plugin` sends to the guides hub so the site gets this plugin's guides.
|
|
4
|
+
* Only call it on the enabled path: installed-but-disabled doesn't count.
|
|
5
|
+
*
|
|
6
|
+
* Every FoundryKit Payload plugin carries its own copy of this file (it's too small for a package);
|
|
7
|
+
* keep them identical.
|
|
8
|
+
*/ export const recordActivePlugin = (config, name)=>{
|
|
9
|
+
const foundrykit = config.custom?.foundrykit ?? {};
|
|
10
|
+
return {
|
|
11
|
+
...config,
|
|
12
|
+
custom: {
|
|
13
|
+
...config.custom,
|
|
14
|
+
foundrykit: {
|
|
15
|
+
...foundrykit,
|
|
16
|
+
activePlugins: [
|
|
17
|
+
...new Set([
|
|
18
|
+
...foundrykit.activePlugins ?? [],
|
|
19
|
+
name
|
|
20
|
+
])
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=activePlugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/activePlugins.ts"],"sourcesContent":["import type { Config } from 'payload';\n\n/**\n * Records this plugin as active in `config.custom.foundrykit.activePlugins`, the list\n * `@foundrykit/guides-plugin` sends to the guides hub so the site gets this plugin's guides.\n * Only call it on the enabled path: installed-but-disabled doesn't count.\n *\n * Every FoundryKit Payload plugin carries its own copy of this file (it's too small for a package);\n * keep them identical.\n */\nexport const recordActivePlugin = (config: Config, name: string): Config => {\n const foundrykit = (config.custom?.foundrykit ?? {}) as {\n activePlugins?: string[];\n };\n return {\n ...config,\n custom: {\n ...config.custom,\n foundrykit: {\n ...foundrykit,\n activePlugins: [\n ...new Set([...(foundrykit.activePlugins ?? []), name]),\n ],\n },\n },\n };\n};\n"],"names":["recordActivePlugin","config","name","foundrykit","custom","activePlugins","Set"],"mappings":"AAEA;;;;;;;CAOC,GACD,OAAO,MAAMA,qBAAqB,CAACC,QAAgBC;IACjD,MAAMC,aAAcF,OAAOG,MAAM,EAAED,cAAc,CAAC;IAGlD,OAAO;QACL,GAAGF,MAAM;QACTG,QAAQ;YACN,GAAGH,OAAOG,MAAM;YAChBD,YAAY;gBACV,GAAGA,UAAU;gBACbE,eAAe;uBACV,IAAIC,IAAI;2BAAKH,WAAWE,aAAa,IAAI,EAAE;wBAAGH;qBAAK;iBACvD;YACH;QACF;IACF;AACF,EAAE"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { recordActivePlugin } from './activePlugins.js';
|
|
1
2
|
import { MetaAlternatesField, MetaDescriptionField, MetaImageField, MetaJsonLdField, MetaNofollowField, MetaNoindexField, MetaPreviewField, MetaTitleField, MetaUrlField, OverviewField, structuredDataRow } from './fields.js';
|
|
2
3
|
import { getGlobalSeoGlobal } from './global.js';
|
|
3
4
|
import { buildAutoAlternatesHook } from './hooks/autoAlternates.js';
|
|
@@ -262,7 +263,7 @@ export const seoPlugin = (pluginOptions)=>(incomingConfig)=>{
|
|
|
262
263
|
// global-seo not available yet (e.g. fresh DB before migrations) — skip silently
|
|
263
264
|
}
|
|
264
265
|
};
|
|
265
|
-
return config;
|
|
266
|
+
return recordActivePlugin(config, '@foundrykit/seo-plugin');
|
|
266
267
|
};
|
|
267
268
|
/** @deprecated Renamed to `seoPlugin`. */ export const advancedSeoPlugin = seoPlugin;
|
|
268
269
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { CollectionSlug, Config, Field, TabsField } from 'payload';\n\nimport {\n MetaAlternatesField,\n MetaDescriptionField,\n MetaImageField,\n MetaJsonLdField,\n MetaNofollowField,\n MetaNoindexField,\n MetaPreviewField,\n MetaTitleField,\n MetaUrlField,\n OverviewField,\n structuredDataRow,\n} from './fields.js';\nimport { getGlobalSeoGlobal } from './global.js';\nimport { buildAutoAlternatesHook } from './hooks/autoAlternates.js';\nimport { buildGenerateMetaHook } from './hooks/generateMeta.js';\nimport { buildOgImageHook } from './hooks/ogImageGenerator.js';\n\n// ---------------------------------------------------------------------------\n// Default JSON-LD templates seeded into global-seo on first run\n// ---------------------------------------------------------------------------\n\nconst DEFAULT_JSON_LD_TEMPLATES = [\n {\n name: 'Web Page',\n template: {\n '@context': 'https://schema.org',\n '@type': 'WebPage',\n },\n },\n {\n name: 'Article',\n template: {\n '@context': 'https://schema.org',\n '@type': 'Article',\n headline: '',\n },\n },\n {\n name: 'Product',\n template: {\n '@context': 'https://schema.org',\n '@type': 'Product',\n name: '',\n },\n },\n {\n name: 'Organization',\n template: {\n '@context': 'https://schema.org',\n '@type': 'Organization',\n name: '',\n },\n },\n {\n name: 'Breadcrumb Trail',\n template: {\n '@context': 'https://schema.org',\n '@type': 'BreadcrumbList',\n itemListElement: [\n { '@type': 'ListItem', item: '', name: 'Home', position: 1 },\n ],\n },\n },\n];\n\nexport type GenerateAlternateURLArgs = {\n collectionSlug: string;\n doc: Record<string, unknown>;\n locale: string;\n};\n\nexport type GenerateOgImageArgs = {\n collectionSlug: string;\n doc: Record<string, unknown>;\n};\n\nexport type GenerateTitleArgs = {\n collectionSlug: string;\n data: Record<string, unknown>;\n req: import('payload').PayloadRequest;\n};\n\nexport type GenerateURLArgs = {\n collectionSlug: string;\n data: Record<string, unknown>;\n req: import('payload').PayloadRequest;\n};\n\nexport type SeoPluginConfig = {\n /**\n * Collections to inject the `meta` SEO group into.\n * Set a collection slug to `true` to enable.\n */\n collections?: Partial<Record<CollectionSlug, true>>;\n /**\n * Disable the plugin without uninstalling it.\n * Keeps DB schema consistent for migrations.\n * @default false\n */\n disabled?: boolean;\n /**\n * Build the URL for an auto-generated alternate.\n * Called once per locale for each document on read.\n * Return null to skip a locale.\n */\n generateAlternateURL?: (\n args: GenerateAlternateURLArgs\n ) => null | Promise<null | string> | string;\n /**\n * Called when the OG image generator is enabled and a document has no\n * meta.image set. Return a Buffer (PNG/JPEG) to save as the OG image,\n * or null to skip generation for this document.\n */\n generateOgImage?: (\n args: GenerateOgImageArgs\n ) => Buffer | null | Promise<Buffer | null>;\n /**\n * Auto-populate meta.title on save when the field is empty.\n * Return a string to set the title, or null to skip.\n */\n generateTitle?: (\n args: GenerateTitleArgs\n ) => string | null | Promise<string | null>;\n /**\n * Auto-populate meta.url (canonical URL) on save when the field is empty.\n * Return a string to set the URL, or null to skip.\n */\n generateURL?: (\n args: GenerateURLArgs\n ) => string | null | Promise<string | null>;\n /**\n * BCP 47 locale codes used when auto-generating hreflang alternates.\n * Required for auto-alternates to work.\n * @example ['en', 'fr', 'de']\n */\n locales?: string[];\n /**\n * Media collection slug(s) used for the image picker.\n * @default ['media']\n */\n mediaCollection?: string[];\n /**\n * When true, injects the SEO fields into a dedicated \"SEO\" tab using Payload's Tabs Field.\n * If the collection's first field is already a `tabs` field, the SEO tab is appended to it.\n * Otherwise a new tabs field is created with a \"Content\" tab wrapping existing fields and\n * an \"SEO\" tab containing the meta fields.\n * @default false\n */\n tabbedUI?: boolean;\n};\n\nexport type {\n Alternate,\n DocWithMeta,\n GlobalSeoDefaults,\n ResolvedMeta,\n} from './helpers.js';\nexport { resolveMeta } from './helpers.js';\nexport type {\n ArticleJsonLdArgs,\n BreadcrumbItem,\n JsonLdBase,\n OrganizationJsonLdArgs,\n ProductJsonLdArgs,\n WebPageJsonLdArgs,\n} from './jsonld.js';\nexport {\n articleJsonLd,\n breadcrumbJsonLd,\n buildJsonLd,\n organizationJsonLd,\n productJsonLd,\n webPageJsonLd,\n} from './jsonld.js';\nexport type { MetadataResult, ToNextMetadataOptions } from './metadata.js';\nexport { toNextMetadata } from './metadata.js';\nexport {\n MetaAlternatesField,\n MetaDescriptionField,\n MetaImageField,\n MetaJsonLdField,\n MetaNofollowField,\n MetaNoindexField,\n MetaPreviewField,\n MetaTitleField,\n MetaUrlField,\n OverviewField,\n structuredDataRow,\n};\n\nexport const seoPlugin =\n (pluginOptions: SeoPluginConfig) =>\n (incomingConfig: Config): Config => {\n const config = { ...incomingConfig };\n const mediaCollection = pluginOptions.mediaCollection ?? ['media'];\n\n // Register the global-seo global\n config.globals = [\n ...(config.globals || []),\n getGlobalSeoGlobal({ mediaCollection }),\n ];\n\n // Inject meta group + hooks into configured collections\n if (pluginOptions.collections) {\n config.collections = (config.collections || []).map(collection => {\n if (!pluginOptions.collections![collection.slug]) {\n return collection;\n }\n\n const collectionSlug = collection.slug;\n\n const generateMetaHook = buildGenerateMetaHook({\n collectionSlug,\n generateTitle: pluginOptions.generateTitle,\n generateURL: pluginOptions.generateURL,\n });\n\n const autoAlternatesHook = buildAutoAlternatesHook({\n collectionSlug,\n generateAlternateURL: pluginOptions.generateAlternateURL,\n locales: pluginOptions.locales ?? [],\n });\n\n const ogImageHook = buildOgImageHook({\n collectionSlug,\n generateOgImage: pluginOptions.generateOgImage,\n mediaCollection: mediaCollection[0] ?? 'media',\n });\n\n const endpoints = Array.isArray(collection.endpoints)\n ? [...collection.endpoints]\n : [];\n\n // Always register the generate-title endpoint — uses user's generateTitle if provided,\n // otherwise falls back to: doc.title + \" | \" + global-seo siteName\n endpoints.push({\n handler: async (req: import('payload').PayloadRequest) => {\n try {\n const data = ((await req.json?.().catch(() => ({}))) ??\n {}) as Record<string, unknown>;\n\n let title: null | string = null;\n\n if (pluginOptions.generateTitle) {\n title = await pluginOptions.generateTitle({\n collectionSlug,\n data,\n req,\n });\n } else {\n // Built-in default: \"Doc Title | Site Name\"\n const docTitle =\n typeof data.title === 'string' ? data.title : null;\n\n let siteName: null | string = null;\n try {\n const globalSeo = await req.payload.findGlobal({\n slug: 'global-seo',\n });\n siteName =\n typeof (globalSeo as Record<string, unknown>).siteName ===\n 'string'\n ? ((globalSeo as Record<string, unknown>)\n .siteName as string)\n : null;\n } catch {\n // global-seo not found — skip site name\n }\n\n if (docTitle && siteName) title = `${docTitle} | ${siteName}`;\n else if (docTitle) title = docTitle;\n }\n\n return Response.json({ title });\n } catch {\n return Response.json({ title: null });\n }\n },\n method: 'post',\n path: '/generate-title',\n });\n\n const seoFields: Field[] = [\n OverviewField({\n descriptionPath: 'meta.metaDescription',\n imagePath: 'meta.metaImage',\n titlePath: 'meta.metaTitle',\n }),\n MetaTitleField({ hasGenerateFn: true }),\n MetaUrlField({}),\n MetaImageField({ relationTo: mediaCollection[0] ?? 'media' }),\n MetaDescriptionField({}),\n MetaNoindexField({}),\n MetaNofollowField({}),\n MetaAlternatesField({}),\n structuredDataRow,\n MetaPreviewField({\n descriptionPath: 'meta.metaDescription',\n titlePath: 'meta.metaTitle',\n }),\n ];\n\n let fields: Field[];\n\n if (pluginOptions.tabbedUI) {\n const firstField = collection.fields[0];\n const firstIsTabsField = firstField?.type === 'tabs';\n\n // Named tab so data saves under meta.* — consistent with hooks and resolveMeta\n const seoTab = { name: 'meta', fields: seoFields, label: 'SEO' };\n\n if (firstIsTabsField) {\n // Append SEO tab to the existing tabs field\n const existingTabs = firstField as TabsField;\n fields = [\n {\n ...existingTabs,\n tabs: [...existingTabs.tabs, seoTab],\n },\n ...collection.fields.slice(1),\n ];\n } else {\n // Wrap all existing fields in a \"Content\" tab, add SEO tab\n fields = [\n {\n type: 'tabs' as const,\n tabs: [\n { fields: collection.fields as Field[], label: 'Content' },\n seoTab,\n ],\n },\n ];\n }\n } else {\n // Default: append a meta group to the sidebar\n fields = [\n ...collection.fields,\n {\n name: 'meta',\n type: 'group' as const,\n admin: { position: 'sidebar' as const },\n fields: seoFields,\n label: 'SEO',\n },\n ];\n }\n\n return {\n ...collection,\n endpoints,\n fields,\n hooks: {\n ...collection.hooks,\n afterChange: [\n ...(collection.hooks?.afterChange ?? []),\n ogImageHook,\n ],\n afterRead: [\n ...(collection.hooks?.afterRead ?? []),\n autoAlternatesHook,\n ],\n beforeChange: [\n ...(collection.hooks?.beforeChange ?? []),\n generateMetaHook,\n ],\n },\n };\n });\n }\n\n // Keep schema consistent even when disabled (important for migrations)\n if (pluginOptions.disabled) {\n return config;\n }\n\n // Seed default JSON-LD templates into global-seo on first run\n const userOnInit = config.onInit;\n config.onInit = async payload => {\n // Run the user's own onInit first\n if (userOnInit) await userOnInit(payload);\n\n try {\n const existing = await payload.findGlobal({ slug: 'global-seo' });\n const templates = (existing as Record<string, unknown>)\n .jsonLdTemplates as unknown[] | undefined;\n\n // Only seed when no templates have been saved yet\n if (!templates || templates.length === 0) {\n await payload.updateGlobal({\n slug: 'global-seo',\n data: {\n jsonLdTemplates: DEFAULT_JSON_LD_TEMPLATES,\n },\n });\n }\n } catch {\n // global-seo not available yet (e.g. fresh DB before migrations) — skip silently\n }\n };\n\n return config;\n };\n\n/** @deprecated Renamed to `seoPlugin`. */\nexport const advancedSeoPlugin = seoPlugin;\n/** @deprecated Renamed to `SeoPluginConfig`. */\nexport type AdvancedSeoPluginConfig = SeoPluginConfig;\n"],"names":["MetaAlternatesField","MetaDescriptionField","MetaImageField","MetaJsonLdField","MetaNofollowField","MetaNoindexField","MetaPreviewField","MetaTitleField","MetaUrlField","OverviewField","structuredDataRow","getGlobalSeoGlobal","buildAutoAlternatesHook","buildGenerateMetaHook","buildOgImageHook","DEFAULT_JSON_LD_TEMPLATES","name","template","headline","itemListElement","item","position","resolveMeta","articleJsonLd","breadcrumbJsonLd","buildJsonLd","organizationJsonLd","productJsonLd","webPageJsonLd","toNextMetadata","seoPlugin","pluginOptions","incomingConfig","config","mediaCollection","globals","collections","map","collection","slug","collectionSlug","generateMetaHook","generateTitle","generateURL","autoAlternatesHook","generateAlternateURL","locales","ogImageHook","generateOgImage","endpoints","Array","isArray","push","handler","req","data","json","catch","title","docTitle","siteName","globalSeo","payload","findGlobal","Response","method","path","seoFields","descriptionPath","imagePath","titlePath","hasGenerateFn","relationTo","fields","tabbedUI","firstField","firstIsTabsField","type","seoTab","label","existingTabs","tabs","slice","admin","hooks","afterChange","afterRead","beforeChange","disabled","userOnInit","onInit","existing","templates","jsonLdTemplates","length","updateGlobal","advancedSeoPlugin"],"mappings":"AAEA,SACEA,mBAAmB,EACnBC,oBAAoB,EACpBC,cAAc,EACdC,eAAe,EACfC,iBAAiB,EACjBC,gBAAgB,EAChBC,gBAAgB,EAChBC,cAAc,EACdC,YAAY,EACZC,aAAa,EACbC,iBAAiB,QACZ,cAAc;AACrB,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,uBAAuB,QAAQ,4BAA4B;AACpE,SAASC,qBAAqB,QAAQ,0BAA0B;AAChE,SAASC,gBAAgB,QAAQ,8BAA8B;AAE/D,8EAA8E;AAC9E,gEAAgE;AAChE,8EAA8E;AAE9E,MAAMC,4BAA4B;IAChC;QACEC,MAAM;QACNC,UAAU;YACR,YAAY;YACZ,SAAS;QACX;IACF;IACA;QACED,MAAM;QACNC,UAAU;YACR,YAAY;YACZ,SAAS;YACTC,UAAU;QACZ;IACF;IACA;QACEF,MAAM;QACNC,UAAU;YACR,YAAY;YACZ,SAAS;YACTD,MAAM;QACR;IACF;IACA;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AAO;wBACL,GAAG9C,WAAW8C,KAAK;wBACnBC,aAAa;+BACP/C,WAAW8C,KAAK,EAAEC,eAAe,EAAE;4BACvCtC;yBACD;wBACDuC,WAAW;+BACLhD,WAAW8C,KAAK,EAAEE,aAAa,EAAE;4BACrC1C;yBACD;wBACD2C,cAAc;+BACRjD,WAAW8C,KAAK,EAAEG,gBAAgB,EAAE;4BACxC9C;yBACD;oBACH;gBACF;YACF;QACF;QAEA,uEAAuE;QACvE,IAAIV,cAAcyD,QAAQ,EAAE;YAC1B,OAAOvD;QACT;QAEA,8DAA8D;QAC9D,MAAMwD,aAAaxD,OAAOyD,MAAM;QAChCzD,OAAOyD,MAAM,GAAG,OAAM5B;YACpB,kCAAkC;YAClC,IAAI2B,YAAY,MAAMA,WAAW3B;YAEjC,IAAI;gBACF,MAAM6B,WAAW,MAAM7B,QAAQC,UAAU,CAAC;oBAAExB,MAAM;gBAAa;gBAC/D,MAAMqD,YAAY,AAACD,SAChBE,eAAe;gBAElB,kDAAkD;gBAClD,IAAI,CAACD,aAAaA,UAAUE,MAAM,KAAK,GAAG;oBACxC,MAAMhC,QAAQiC,YAAY,CAAC;wBACzBxD,MAAM;wBACNgB,MAAM;4BACJsC,iBAAiB9E;wBACnB;oBACF;gBACF;YACF,EAAE,OAAM;YACN,iFAAiF;YACnF;QACF;QAEA,OAAOkB;IACT,EAAE;AAEJ,wCAAwC,GACxC,OAAO,MAAM+D,oBAAoBlE,UAAU"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { CollectionSlug, Config, Field, TabsField } from 'payload';\nimport { recordActivePlugin } from './activePlugins.js';\nimport {\n MetaAlternatesField,\n MetaDescriptionField,\n MetaImageField,\n MetaJsonLdField,\n MetaNofollowField,\n MetaNoindexField,\n MetaPreviewField,\n MetaTitleField,\n MetaUrlField,\n OverviewField,\n structuredDataRow,\n} from './fields.js';\nimport { getGlobalSeoGlobal } from './global.js';\nimport { buildAutoAlternatesHook } from './hooks/autoAlternates.js';\nimport { buildGenerateMetaHook } from './hooks/generateMeta.js';\nimport { buildOgImageHook } from './hooks/ogImageGenerator.js';\n\n// ---------------------------------------------------------------------------\n// Default JSON-LD templates seeded into global-seo on first run\n// ---------------------------------------------------------------------------\n\nconst DEFAULT_JSON_LD_TEMPLATES = [\n {\n name: 'Web Page',\n template: {\n '@context': 'https://schema.org',\n '@type': 'WebPage',\n },\n },\n {\n name: 'Article',\n template: {\n '@context': 'https://schema.org',\n '@type': 'Article',\n headline: '',\n },\n },\n {\n name: 'Product',\n template: {\n '@context': 'https://schema.org',\n '@type': 'Product',\n name: '',\n },\n },\n {\n name: 'Organization',\n template: {\n '@context': 'https://schema.org',\n '@type': 'Organization',\n name: '',\n },\n },\n {\n name: 'Breadcrumb Trail',\n template: {\n '@context': 'https://schema.org',\n '@type': 'BreadcrumbList',\n itemListElement: [\n { '@type': 'ListItem', item: '', name: 'Home', position: 1 },\n ],\n },\n },\n];\n\nexport type GenerateAlternateURLArgs = {\n collectionSlug: string;\n doc: Record<string, unknown>;\n locale: string;\n};\n\nexport type GenerateOgImageArgs = {\n collectionSlug: string;\n doc: Record<string, unknown>;\n};\n\nexport type GenerateTitleArgs = {\n collectionSlug: string;\n data: Record<string, unknown>;\n req: import('payload').PayloadRequest;\n};\n\nexport type GenerateURLArgs = {\n collectionSlug: string;\n data: Record<string, unknown>;\n req: import('payload').PayloadRequest;\n};\n\nexport type SeoPluginConfig = {\n /**\n * Collections to inject the `meta` SEO group into.\n * Set a collection slug to `true` to enable.\n */\n collections?: Partial<Record<CollectionSlug, true>>;\n /**\n * Disable the plugin without uninstalling it.\n * Keeps DB schema consistent for migrations.\n * @default false\n */\n disabled?: boolean;\n /**\n * Build the URL for an auto-generated alternate.\n * Called once per locale for each document on read.\n * Return null to skip a locale.\n */\n generateAlternateURL?: (\n args: GenerateAlternateURLArgs\n ) => null | Promise<null | string> | string;\n /**\n * Called when the OG image generator is enabled and a document has no\n * meta.image set. Return a Buffer (PNG/JPEG) to save as the OG image,\n * or null to skip generation for this document.\n */\n generateOgImage?: (\n args: GenerateOgImageArgs\n ) => Buffer | null | Promise<Buffer | null>;\n /**\n * Auto-populate meta.title on save when the field is empty.\n * Return a string to set the title, or null to skip.\n */\n generateTitle?: (\n args: GenerateTitleArgs\n ) => string | null | Promise<string | null>;\n /**\n * Auto-populate meta.url (canonical URL) on save when the field is empty.\n * Return a string to set the URL, or null to skip.\n */\n generateURL?: (\n args: GenerateURLArgs\n ) => string | null | Promise<string | null>;\n /**\n * BCP 47 locale codes used when auto-generating hreflang alternates.\n * Required for auto-alternates to work.\n * @example ['en', 'fr', 'de']\n */\n locales?: string[];\n /**\n * Media collection slug(s) used for the image picker.\n * @default ['media']\n */\n mediaCollection?: string[];\n /**\n * When true, injects the SEO fields into a dedicated \"SEO\" tab using Payload's Tabs Field.\n * If the collection's first field is already a `tabs` field, the SEO tab is appended to it.\n * Otherwise a new tabs field is created with a \"Content\" tab wrapping existing fields and\n * an \"SEO\" tab containing the meta fields.\n * @default false\n */\n tabbedUI?: boolean;\n};\n\nexport type {\n Alternate,\n DocWithMeta,\n GlobalSeoDefaults,\n ResolvedMeta,\n} from './helpers.js';\nexport { resolveMeta } from './helpers.js';\nexport type {\n ArticleJsonLdArgs,\n BreadcrumbItem,\n JsonLdBase,\n OrganizationJsonLdArgs,\n ProductJsonLdArgs,\n WebPageJsonLdArgs,\n} from './jsonld.js';\nexport {\n articleJsonLd,\n breadcrumbJsonLd,\n buildJsonLd,\n organizationJsonLd,\n productJsonLd,\n webPageJsonLd,\n} from './jsonld.js';\nexport type { MetadataResult, ToNextMetadataOptions } from './metadata.js';\nexport { toNextMetadata } from './metadata.js';\nexport {\n MetaAlternatesField,\n MetaDescriptionField,\n MetaImageField,\n MetaJsonLdField,\n MetaNofollowField,\n MetaNoindexField,\n MetaPreviewField,\n MetaTitleField,\n MetaUrlField,\n OverviewField,\n structuredDataRow,\n};\n\nexport const seoPlugin =\n (pluginOptions: SeoPluginConfig) =>\n (incomingConfig: Config): Config => {\n const config = { ...incomingConfig };\n const mediaCollection = pluginOptions.mediaCollection ?? ['media'];\n\n // Register the global-seo global\n config.globals = [\n ...(config.globals || []),\n getGlobalSeoGlobal({ mediaCollection }),\n ];\n\n // Inject meta group + hooks into configured collections\n if (pluginOptions.collections) {\n config.collections = (config.collections || []).map(collection => {\n if (!pluginOptions.collections![collection.slug]) {\n return collection;\n }\n\n const collectionSlug = collection.slug;\n\n const generateMetaHook = buildGenerateMetaHook({\n collectionSlug,\n generateTitle: pluginOptions.generateTitle,\n generateURL: pluginOptions.generateURL,\n });\n\n const autoAlternatesHook = buildAutoAlternatesHook({\n collectionSlug,\n generateAlternateURL: pluginOptions.generateAlternateURL,\n locales: pluginOptions.locales ?? [],\n });\n\n const ogImageHook = buildOgImageHook({\n collectionSlug,\n generateOgImage: pluginOptions.generateOgImage,\n mediaCollection: mediaCollection[0] ?? 'media',\n });\n\n const endpoints = Array.isArray(collection.endpoints)\n ? [...collection.endpoints]\n : [];\n\n // Always register the generate-title endpoint — uses user's generateTitle if provided,\n // otherwise falls back to: doc.title + \" | \" + global-seo siteName\n endpoints.push({\n handler: async (req: import('payload').PayloadRequest) => {\n try {\n const data = ((await req.json?.().catch(() => ({}))) ??\n {}) as Record<string, unknown>;\n\n let title: null | string = null;\n\n if (pluginOptions.generateTitle) {\n title = await pluginOptions.generateTitle({\n collectionSlug,\n data,\n req,\n });\n } else {\n // Built-in default: \"Doc Title | Site Name\"\n const docTitle =\n typeof data.title === 'string' ? data.title : null;\n\n let siteName: null | string = null;\n try {\n const globalSeo = await req.payload.findGlobal({\n slug: 'global-seo',\n });\n siteName =\n typeof (globalSeo as Record<string, unknown>).siteName ===\n 'string'\n ? ((globalSeo as Record<string, unknown>)\n .siteName as string)\n : null;\n } catch {\n // global-seo not found — skip site name\n }\n\n if (docTitle && siteName) title = `${docTitle} | ${siteName}`;\n else if (docTitle) title = docTitle;\n }\n\n return Response.json({ title });\n } catch {\n return Response.json({ title: null });\n }\n },\n method: 'post',\n path: '/generate-title',\n });\n\n const seoFields: Field[] = [\n OverviewField({\n descriptionPath: 'meta.metaDescription',\n imagePath: 'meta.metaImage',\n titlePath: 'meta.metaTitle',\n }),\n MetaTitleField({ hasGenerateFn: true }),\n MetaUrlField({}),\n MetaImageField({ relationTo: mediaCollection[0] ?? 'media' }),\n MetaDescriptionField({}),\n MetaNoindexField({}),\n MetaNofollowField({}),\n MetaAlternatesField({}),\n structuredDataRow,\n MetaPreviewField({\n descriptionPath: 'meta.metaDescription',\n titlePath: 'meta.metaTitle',\n }),\n ];\n\n let fields: Field[];\n\n if (pluginOptions.tabbedUI) {\n const firstField = collection.fields[0];\n const firstIsTabsField = firstField?.type === 'tabs';\n\n // Named tab so data saves under meta.* — consistent with hooks and resolveMeta\n const seoTab = { name: 'meta', fields: seoFields, label: 'SEO' };\n\n if (firstIsTabsField) {\n // Append SEO tab to the existing tabs field\n const existingTabs = firstField as TabsField;\n fields = [\n {\n ...existingTabs,\n tabs: [...existingTabs.tabs, seoTab],\n },\n ...collection.fields.slice(1),\n ];\n } else {\n // Wrap all existing fields in a \"Content\" tab, add SEO tab\n fields = [\n {\n type: 'tabs' as const,\n tabs: [\n { fields: collection.fields as Field[], label: 'Content' },\n seoTab,\n ],\n },\n ];\n }\n } else {\n // Default: append a meta group to the sidebar\n fields = [\n ...collection.fields,\n {\n name: 'meta',\n type: 'group' as const,\n admin: { position: 'sidebar' as const },\n fields: seoFields,\n label: 'SEO',\n },\n ];\n }\n\n return {\n ...collection,\n endpoints,\n fields,\n hooks: {\n ...collection.hooks,\n afterChange: [\n ...(collection.hooks?.afterChange ?? []),\n ogImageHook,\n ],\n afterRead: [\n ...(collection.hooks?.afterRead ?? []),\n autoAlternatesHook,\n ],\n beforeChange: [\n ...(collection.hooks?.beforeChange ?? []),\n generateMetaHook,\n ],\n },\n };\n });\n }\n\n // Keep schema consistent even when disabled (important for migrations)\n if (pluginOptions.disabled) {\n return config;\n }\n\n // Seed default JSON-LD templates into global-seo on first run\n const userOnInit = config.onInit;\n config.onInit = async payload => {\n // Run the user's own onInit first\n if (userOnInit) await userOnInit(payload);\n\n try {\n const existing = await payload.findGlobal({ slug: 'global-seo' });\n const templates = (existing as Record<string, unknown>)\n .jsonLdTemplates as unknown[] | undefined;\n\n // Only seed when no templates have been saved yet\n if (!templates || templates.length === 0) {\n await payload.updateGlobal({\n slug: 'global-seo',\n data: {\n jsonLdTemplates: DEFAULT_JSON_LD_TEMPLATES,\n },\n });\n }\n } catch {\n // global-seo not available yet (e.g. fresh DB before migrations) — skip silently\n }\n };\n\n return recordActivePlugin(config, '@foundrykit/seo-plugin');\n };\n\n/** @deprecated Renamed to `seoPlugin`. */\nexport const advancedSeoPlugin = seoPlugin;\n/** @deprecated Renamed to `SeoPluginConfig`. */\nexport type AdvancedSeoPluginConfig = SeoPluginConfig;\n"],"names":["recordActivePlugin","MetaAlternatesField","MetaDescriptionField","MetaImageField","MetaJsonLdField","MetaNofollowField","MetaNoindexField","MetaPreviewField","MetaTitleField","MetaUrlField","OverviewField","structuredDataRow","getGlobalSeoGlobal","buildAutoAlternatesHook","buildGenerateMetaHook","buildOgImageHook","DEFAULT_JSON_LD_TEMPLATES","name","template","headline","itemListElement","item","position","resolveMeta","articleJsonLd","breadcrumbJsonLd","buildJsonLd","organizationJsonLd","productJsonLd","webPageJsonLd","toNextMetadata","seoPlugin","pluginOptions","incomingConfig","config","mediaCollection","globals","collections","map","collection","slug","collectionSlug","generateMetaHook","generateTitle","generateURL","autoAlternatesHook","generateAlternateURL","locales","ogImageHook","generateOgImage","endpoints","Array","isArray","push","handler","req","data","json","catch","title","docTitle","siteName","globalSeo","payload","findGlobal","Response","method","path","seoFields","descriptionPath","imagePath","titlePath","hasGenerateFn","relationTo","fields","tabbedUI","firstField","firstIsTabsField","type","seoTab","label","existingTabs","tabs","slice","admin","hooks","afterChange","afterRead","beforeChange","disabled","userOnInit","onInit","existing","templates","jsonLdTemplates","length","updateGlobal","advancedSeoPlugin"],"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,SAChBE,eAAe;gBAElB,kDAAkD;gBAClD,IAAI,CAACD,aAAaA,UAAUE,MAAM,KAAK,GAAG;oBACxC,MAAMhC,QAAQiC,YAAY,CAAC;wBACzBxD,MAAM;wBACNgB,MAAM;4BACJsC,iBAAiB9E;wBACnB;oBACF;gBACF;YACF,EAAE,OAAM;YACN,iFAAiF;YACnF;QACF;QAEA,OAAOhB,mBAAmBkC,QAAQ;IACpC,EAAE;AAEJ,wCAAwC,GACxC,OAAO,MAAM+D,oBAAoBlE,UAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foundrykit/seo-plugin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "A plugin for Payload CMS that provides advanced SEO features, including automatic generation of meta tags, sitemaps, and structured data based on your content.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|