@actuate-media/plugin-seo 0.0.11 → 0.0.13
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/CHANGELOG.md +117 -0
- package/README.md +29 -0
- package/dist/__tests__/index.test.js +5 -0
- package/dist/__tests__/index.test.js.map +1 -1
- package/dist/admin/GooglePreview.d.ts.map +1 -1
- package/dist/admin/GooglePreview.js +2 -1
- package/dist/admin/GooglePreview.js.map +1 -1
- package/dist/admin/SEOPanel.d.ts.map +1 -1
- package/dist/admin/SEOPanel.js +13 -2
- package/dist/admin/SEOPanel.js.map +1 -1
- package/dist/admin/SchemaPreview.d.ts.map +1 -1
- package/dist/admin/SchemaPreview.js +12 -2
- package/dist/admin/SchemaPreview.js.map +1 -1
- package/dist/canonical/index.d.ts.map +1 -1
- package/dist/canonical/index.js +8 -8
- package/dist/canonical/index.js.map +1 -1
- package/dist/collections.d.ts +1 -1
- package/dist/collections.d.ts.map +1 -1
- package/dist/collections.js.map +1 -1
- package/dist/fields.d.ts +1 -1
- package/dist/fields.d.ts.map +1 -1
- package/dist/fields.js +58 -58
- package/dist/fields.js.map +1 -1
- package/dist/hooks.d.ts +7 -0
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +10 -16
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +23 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -21
- package/dist/index.js.map +1 -1
- package/dist/link-health/index.d.ts +1 -1
- package/dist/link-health/index.d.ts.map +1 -1
- package/dist/link-health/index.js +14 -14
- package/dist/link-health/index.js.map +1 -1
- package/dist/og-image/index.d.ts +1 -1
- package/dist/og-image/index.d.ts.map +1 -1
- package/dist/og-image/index.js +12 -12
- package/dist/og-image/index.js.map +1 -1
- package/dist/robots/index.d.ts.map +1 -1
- package/dist/robots/index.js +14 -16
- package/dist/robots/index.js.map +1 -1
- package/dist/schema/auto-detect.d.ts +2 -2
- package/dist/schema/auto-detect.d.ts.map +1 -1
- package/dist/schema/auto-detect.js +2 -27
- package/dist/schema/auto-detect.js.map +1 -1
- package/dist/schema/composer.d.ts.map +1 -1
- package/dist/schema/composer.js +20 -26
- package/dist/schema/composer.js.map +1 -1
- package/dist/schema/registry.d.ts +28 -28
- package/dist/schema/registry.d.ts.map +1 -1
- package/dist/schema/validator.d.ts +1 -1
- package/dist/schema/validator.d.ts.map +1 -1
- package/dist/schema/validator.js +52 -52
- package/dist/schema/validator.js.map +1 -1
- package/dist/sitemap/index.d.ts +3 -3
- package/dist/sitemap/index.d.ts.map +1 -1
- package/dist/sitemap/index.js +32 -31
- package/dist/sitemap/index.js.map +1 -1
- package/package.json +5 -3
package/dist/fields.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../src/fields.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAoC;IACxD,SAAS,EAAE;QACT,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,YAAY;QACnB,SAAS,EAAE,EAAE;QACb,KAAK,EAAE;YACL,QAAQ,EAAE,SAAS;YACnB,WAAW,
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../src/fields.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAoC;IACxD,SAAS,EAAE;QACT,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,YAAY;QACnB,SAAS,EAAE,EAAE;QACb,KAAK,EAAE;YACL,QAAQ,EAAE,SAAS;YACnB,WAAW,EACT,qFAAqF;SACxF;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,kBAAkB;QACzB,SAAS,EAAE,GAAG;QACd,KAAK,EAAE;YACL,QAAQ,EAAE,SAAS;YACnB,WAAW,EACT,oFAAoF;SACvF;KACF;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,eAAe;QACtB,KAA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KAAK,EAAE,WAAW;QAClB,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE;YACL,QAAQ,EAAE,SAAS;YACnB,WAAW,EAAE,2DAA2D;SACzE;KACF;IACD,kBAAkB,EAAE;QAClB,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,sBAAsB;QAC7B,OAAO,EAAE;YACP,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;YACtC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE;YACvC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;YACpC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;YAClC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE;YACvC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;YACtC,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,YAAY,EAAE;YAC7C,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,eAAe,EAAE;YACnD,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;YACpC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;SACvC;QACD,KAAK,EAAE;YACL,QAAQ,EAAE,SAAS;YACnB,WAAW,EAAE,gFAAgF;SAC9F;KACF;IACD,uBAAuB,EAAE;QACvB,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,2BAA2B;QAClC,KAAK,EAAE;YACL,WAAW,EAAE,0EAA0E;SACxF;KACF;CACF,CAAA"}
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin lifecycle hooks.
|
|
3
|
+
*
|
|
4
|
+
* Schema defaults and structured-data stamping are handled in cms-core
|
|
5
|
+
* (`prepareContentStructuredData` on document create/update). Hooks here are
|
|
6
|
+
* limited to cache invalidation side effects.
|
|
7
|
+
*/
|
|
1
8
|
export declare const seoHooks: Array<{
|
|
2
9
|
event: string;
|
|
3
10
|
handler: (...args: unknown[]) => Promise<void> | void;
|
package/dist/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;CACtD,CAgBA,CAAA"}
|
package/dist/hooks.js
CHANGED
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Plugin lifecycle hooks.
|
|
3
|
+
*
|
|
4
|
+
* Schema defaults and structured-data stamping are handled in cms-core
|
|
5
|
+
* (`prepareContentStructuredData` on document create/update). Hooks here are
|
|
6
|
+
* limited to cache invalidation side effects.
|
|
7
|
+
*/
|
|
2
8
|
export const seoHooks = [
|
|
3
9
|
{
|
|
4
|
-
event:
|
|
5
|
-
handler: (...args) => {
|
|
6
|
-
const [data] = args;
|
|
7
|
-
if (!data)
|
|
8
|
-
return;
|
|
9
|
-
const collectionSlug = data._collection ?? "";
|
|
10
|
-
if (!data.structuredDataType && collectionSlug) {
|
|
11
|
-
data.structuredDataType = detectSchemaType(collectionSlug);
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
event: "afterUpdate",
|
|
10
|
+
event: 'afterUpdate',
|
|
17
11
|
handler: async (...args) => {
|
|
18
12
|
const [data] = args;
|
|
19
13
|
if (!data)
|
|
20
14
|
return;
|
|
21
|
-
const cacheKey = `sitemap:${data._collection ??
|
|
22
|
-
if (typeof globalThis !==
|
|
15
|
+
const cacheKey = `sitemap:${data._collection ?? 'global'}`;
|
|
16
|
+
if (typeof globalThis !== 'undefined') {
|
|
23
17
|
const cache = globalThis.__sitemapCache;
|
|
24
18
|
cache?.delete(cacheKey);
|
|
25
19
|
}
|
package/dist/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAGhB;IACH;QACE,KAAK,EAAE,aAAa;QACpB,OAAO,EAAE,KAAK,EAAE,GAAG,IAAe,EAAE,EAAE;YACpC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAiC,CAAA;YAChD,IAAI,CAAC,IAAI;gBAAE,OAAM;YAEjB,MAAM,QAAQ,GAAG,WAAY,IAAI,CAAC,WAAsB,IAAI,QAAQ,EAAE,CAAA;YACtE,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE,CAAC;gBACtC,MAAM,KAAK,GAAI,UAAsC,CAAC,cAEzC,CAAA;gBACb,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAA;YACzB,CAAC;QACH,CAAC;KACF;CACF,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldDefinition, CollectionDefinition } from
|
|
1
|
+
import type { FieldDefinition, CollectionDefinition } from '@actuate-media/cms-core';
|
|
2
2
|
export interface ActuatePlugin {
|
|
3
3
|
name: string;
|
|
4
4
|
fields?: Record<string, FieldDefinition>;
|
|
@@ -17,7 +17,7 @@ export interface SEOPluginConfig {
|
|
|
17
17
|
sitemap?: {
|
|
18
18
|
enabled?: boolean;
|
|
19
19
|
excludeCollections?: string[];
|
|
20
|
-
changeFrequency?:
|
|
20
|
+
changeFrequency?: 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never';
|
|
21
21
|
defaultPriority?: number;
|
|
22
22
|
};
|
|
23
23
|
robots?: {
|
|
@@ -31,7 +31,7 @@ export interface SEOPluginConfig {
|
|
|
31
31
|
};
|
|
32
32
|
ogImage?: {
|
|
33
33
|
enabled?: boolean;
|
|
34
|
-
defaultTheme?:
|
|
34
|
+
defaultTheme?: 'light' | 'dark';
|
|
35
35
|
siteName?: string;
|
|
36
36
|
};
|
|
37
37
|
linkHealth?: {
|
|
@@ -49,24 +49,24 @@ export interface SEOPluginConfig {
|
|
|
49
49
|
}
|
|
50
50
|
/** Creates an SEO plugin instance for Actuate CMS. */
|
|
51
51
|
export declare function seoPlugin(config?: SEOPluginConfig): ActuatePlugin;
|
|
52
|
-
export { seoFields } from
|
|
53
|
-
export { seoCollections } from
|
|
54
|
-
export { seoHooks } from
|
|
55
|
-
export { detectSchemaType } from
|
|
56
|
-
export { composeSchema } from
|
|
57
|
-
export { validateSchema } from
|
|
58
|
-
export type { ValidationResult } from
|
|
59
|
-
export { generateSitemapIndex, generateCollectionSitemap, generateImageSitemap, generateVideoSitemap, generateNewsSitemap, generateHreflangSitemap, buildDocumentUrl, } from
|
|
60
|
-
export type { SitemapEntry, ImageSitemapEntry, VideoSitemapEntry, NewsSitemapEntry, HreflangEntry, CollectionSitemapConfig, } from
|
|
61
|
-
export { generateRobotsTxt } from
|
|
62
|
-
export type { RobotsConfig } from
|
|
63
|
-
export { generateOGImage } from
|
|
64
|
-
export type { OGImageOptions } from
|
|
65
|
-
export { detectBrokenLinks, detectOrphanPages, detectRedirectChains
|
|
66
|
-
export { detectDuplicates, suggestCanonical } from
|
|
67
|
-
export type { DuplicateGroup } from
|
|
68
|
-
export { SEOPanel } from
|
|
69
|
-
export { GooglePreview } from
|
|
70
|
-
export { SchemaPreview } from
|
|
71
|
-
export type { SchemaOrgThing, SchemaOrgArticle, SchemaOrgPerson, SchemaOrgOrganization, SchemaOrgWebPage, SchemaOrgEvent, SchemaOrgFAQPage, SchemaOrgService, SchemaOrgJobPosting, SchemaOrgLocalBusiness, SchemaOrgReview, SchemaOrgProduct, } from
|
|
52
|
+
export { seoFields } from './fields.js';
|
|
53
|
+
export { seoCollections } from './collections.js';
|
|
54
|
+
export { seoHooks } from './hooks.js';
|
|
55
|
+
export { detectSchemaType } from './schema/auto-detect.js';
|
|
56
|
+
export { composeSchema } from './schema/composer.js';
|
|
57
|
+
export { validateSchema } from './schema/validator.js';
|
|
58
|
+
export type { ValidationResult } from './schema/validator.js';
|
|
59
|
+
export { generateSitemapIndex, generateCollectionSitemap, generateImageSitemap, generateVideoSitemap, generateNewsSitemap, generateHreflangSitemap, buildDocumentUrl, } from './sitemap/index.js';
|
|
60
|
+
export type { SitemapEntry, ImageSitemapEntry, VideoSitemapEntry, NewsSitemapEntry, HreflangEntry, CollectionSitemapConfig, } from './sitemap/index.js';
|
|
61
|
+
export { generateRobotsTxt } from './robots/index.js';
|
|
62
|
+
export type { RobotsConfig } from './robots/index.js';
|
|
63
|
+
export { generateOGImage } from './og-image/index.js';
|
|
64
|
+
export type { OGImageOptions } from './og-image/index.js';
|
|
65
|
+
export { detectBrokenLinks, detectOrphanPages, detectRedirectChains } from './link-health/index.js';
|
|
66
|
+
export { detectDuplicates, suggestCanonical } from './canonical/index.js';
|
|
67
|
+
export type { DuplicateGroup } from './canonical/index.js';
|
|
68
|
+
export { SEOPanel } from './admin/SEOPanel.js';
|
|
69
|
+
export { GooglePreview } from './admin/GooglePreview.js';
|
|
70
|
+
export { SchemaPreview } from './admin/SchemaPreview.js';
|
|
71
|
+
export type { SchemaOrgThing, SchemaOrgArticle, SchemaOrgPerson, SchemaOrgOrganization, SchemaOrgWebPage, SchemaOrgEvent, SchemaOrgFAQPage, SchemaOrgService, SchemaOrgJobPosting, SchemaOrgLocalBusiness, SchemaOrgReview, SchemaOrgProduct, } from './schema/registry.js';
|
|
72
72
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAKpF,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;IAClD,aAAa,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACpE,KAAK,CAAC,EAAE,KAAK,CAAC;QACZ,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;KACtD,CAAC,CAAA;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;QAC7B,eAAe,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;QAC3F,eAAe,CAAC,EAAE,MAAM,CAAA;KACzB,CAAA;IACD,MAAM,CAAC,EAA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BAAmB,EACnB,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,uBAAuB,GACxB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AACnG,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACzE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAExD,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,GACjB,MAAM,sBAAsB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { seoFields } from
|
|
2
|
-
import { seoCollections } from
|
|
3
|
-
import { seoHooks } from
|
|
1
|
+
import { seoFields } from './fields.js';
|
|
2
|
+
import { seoCollections } from './collections.js';
|
|
3
|
+
import { seoHooks } from './hooks.js';
|
|
4
4
|
/** Creates an SEO plugin instance for Actuate CMS. */
|
|
5
5
|
export function seoPlugin(config = {}) {
|
|
6
6
|
return {
|
|
7
|
-
name:
|
|
7
|
+
name: 'plugin-seo',
|
|
8
8
|
fields: { ...seoFields },
|
|
9
9
|
collections: { ...seoCollections },
|
|
10
10
|
adminNavItems: [
|
|
11
|
-
{ label:
|
|
12
|
-
{ label:
|
|
13
|
-
{ label:
|
|
11
|
+
{ label: 'SEO Overview', icon: 'search', path: '/seo' },
|
|
12
|
+
{ label: 'Sitemap', icon: 'map', path: '/seo/sitemap' },
|
|
13
|
+
{ label: 'Link Health', icon: 'link', path: '/seo/link-health' },
|
|
14
14
|
],
|
|
15
15
|
hooks: seoHooks.map((hook) => ({
|
|
16
16
|
...hook,
|
|
@@ -18,18 +18,18 @@ export function seoPlugin(config = {}) {
|
|
|
18
18
|
})),
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
export { seoFields } from
|
|
22
|
-
export { seoCollections } from
|
|
23
|
-
export { seoHooks } from
|
|
24
|
-
export { detectSchemaType } from
|
|
25
|
-
export { composeSchema } from
|
|
26
|
-
export { validateSchema } from
|
|
27
|
-
export { generateSitemapIndex, generateCollectionSitemap, generateImageSitemap, generateVideoSitemap, generateNewsSitemap, generateHreflangSitemap, buildDocumentUrl, } from
|
|
28
|
-
export { generateRobotsTxt } from
|
|
29
|
-
export { generateOGImage } from
|
|
30
|
-
export { detectBrokenLinks, detectOrphanPages, detectRedirectChains
|
|
31
|
-
export { detectDuplicates, suggestCanonical } from
|
|
32
|
-
export { SEOPanel } from
|
|
33
|
-
export { GooglePreview } from
|
|
34
|
-
export { SchemaPreview } from
|
|
21
|
+
export { seoFields } from './fields.js';
|
|
22
|
+
export { seoCollections } from './collections.js';
|
|
23
|
+
export { seoHooks } from './hooks.js';
|
|
24
|
+
export { detectSchemaType } from './schema/auto-detect.js';
|
|
25
|
+
export { composeSchema } from './schema/composer.js';
|
|
26
|
+
export { validateSchema } from './schema/validator.js';
|
|
27
|
+
export { generateSitemapIndex, generateCollectionSitemap, generateImageSitemap, generateVideoSitemap, generateNewsSitemap, generateHreflangSitemap, buildDocumentUrl, } from './sitemap/index.js';
|
|
28
|
+
export { generateRobotsTxt } from './robots/index.js';
|
|
29
|
+
export { generateOGImage } from './og-image/index.js';
|
|
30
|
+
export { detectBrokenLinks, detectOrphanPages, detectRedirectChains } from './link-health/index.js';
|
|
31
|
+
export { detectDuplicates, suggestCanonical } from './canonical/index.js';
|
|
32
|
+
export { SEOPanel } from './admin/SEOPanel.js';
|
|
33
|
+
export { GooglePreview } from './admin/GooglePreview.js';
|
|
34
|
+
export { SchemaPreview } from './admin/SchemaPreview.js';
|
|
35
35
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AA4CrC,sDAAsD;AACtD,MAAM,UAAU,SAAS,CAAC,SAA0B,EAAE;IACpD,OAAO;QACL,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,EAAE,GAAG,SAAS,EAAE;QACxB,WAAW,EAAE,EAAE,GAAG,cAAc,EAAE;QAClC,aAAa,EAAE;YACb,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE;YACvD,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE;YACvD,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE;SACjE;QACD,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC7B,GAAG,IAAI;YACP,aAAa,EAAE,MAAM;SACtB,CAAC,CAA2B;KAC9B,CAAA;AACH,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,oBAAoB,CAAA;AAS3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AACnG,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEzE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/link-health/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/link-health/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAAA;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf;AAID,4DAA4D;AAC5D,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAmD7B;AAED,2DAA2D;AAC3D,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAGrF;AAED,wDAAwD;AACxD,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,GAC7C,aAAa,EAAE,CA0BjB"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
const LINK_REGEX = /href=["']([^"']+)["']/gi;
|
|
2
2
|
/** Scans HTML content for links and checks their health. */
|
|
3
3
|
export async function detectBrokenLinks(content, baseUrl) {
|
|
4
|
-
const base = baseUrl.replace(/\/$/,
|
|
4
|
+
const base = baseUrl.replace(/\/$/, '');
|
|
5
5
|
const results = [];
|
|
6
6
|
const seen = new Set();
|
|
7
7
|
let match;
|
|
8
8
|
while ((match = LINK_REGEX.exec(content)) !== null) {
|
|
9
9
|
const href = match[1];
|
|
10
|
-
if (!href || href.startsWith(
|
|
10
|
+
if (!href || href.startsWith('#') || href.startsWith('mailto:') || href.startsWith('tel:')) {
|
|
11
11
|
continue;
|
|
12
12
|
}
|
|
13
|
-
const url = href.startsWith(
|
|
13
|
+
const url = href.startsWith('http') ? href : `${base}${href.startsWith('/') ? '' : '/'}${href}`;
|
|
14
14
|
if (seen.has(url))
|
|
15
15
|
continue;
|
|
16
16
|
seen.add(url);
|
|
@@ -18,32 +18,32 @@ export async function detectBrokenLinks(content, baseUrl) {
|
|
|
18
18
|
const controller = new AbortController();
|
|
19
19
|
const timeout = setTimeout(() => controller.abort(), 10_000);
|
|
20
20
|
const response = await fetch(url, {
|
|
21
|
-
method:
|
|
21
|
+
method: 'HEAD',
|
|
22
22
|
signal: controller.signal,
|
|
23
|
-
redirect:
|
|
23
|
+
redirect: 'manual',
|
|
24
24
|
});
|
|
25
25
|
clearTimeout(timeout);
|
|
26
26
|
if (response.status >= 300 && response.status < 400) {
|
|
27
27
|
results.push({
|
|
28
28
|
url,
|
|
29
|
-
status:
|
|
29
|
+
status: 'redirect',
|
|
30
30
|
statusCode: response.status,
|
|
31
|
-
redirectTarget: response.headers.get(
|
|
31
|
+
redirectTarget: response.headers.get('location') ?? undefined,
|
|
32
32
|
source: href,
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
else if (response.ok) {
|
|
36
|
-
results.push({ url, status:
|
|
36
|
+
results.push({ url, status: 'ok', statusCode: response.status, source: href });
|
|
37
37
|
}
|
|
38
38
|
else {
|
|
39
|
-
results.push({ url, status:
|
|
39
|
+
results.push({ url, status: 'broken', statusCode: response.status, source: href });
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
catch (error) {
|
|
43
|
-
const isAbort = error instanceof DOMException && error.name ===
|
|
43
|
+
const isAbort = error instanceof DOMException && error.name === 'AbortError';
|
|
44
44
|
results.push({
|
|
45
45
|
url,
|
|
46
|
-
status: isAbort ?
|
|
46
|
+
status: isAbort ? 'timeout' : 'error',
|
|
47
47
|
source: href,
|
|
48
48
|
});
|
|
49
49
|
}
|
|
@@ -52,8 +52,8 @@ export async function detectBrokenLinks(content, baseUrl) {
|
|
|
52
52
|
}
|
|
53
53
|
/** Finds pages that are not linked from any other page. */
|
|
54
54
|
export function detectOrphanPages(allPages, linkedPages) {
|
|
55
|
-
const linkedSet = new Set(linkedPages.map((p) => p.replace(/\/$/,
|
|
56
|
-
return allPages.filter((page) => !linkedSet.has(page.replace(/\/$/,
|
|
55
|
+
const linkedSet = new Set(linkedPages.map((p) => p.replace(/\/$/, '').toLowerCase()));
|
|
56
|
+
return allPages.filter((page) => !linkedSet.has(page.replace(/\/$/, '').toLowerCase()));
|
|
57
57
|
}
|
|
58
58
|
/** Detects redirect chains longer than a single hop. */
|
|
59
59
|
export function detectRedirectChains(redirects) {
|
|
@@ -72,7 +72,7 @@ export function detectRedirectChains(redirects) {
|
|
|
72
72
|
chains.push({
|
|
73
73
|
initialUrl: from,
|
|
74
74
|
chain,
|
|
75
|
-
finalUrl: chain[chain.length - 1] ??
|
|
75
|
+
finalUrl: chain[chain.length - 1] ?? '',
|
|
76
76
|
length: chain.length - 1,
|
|
77
77
|
});
|
|
78
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/link-health/index.ts"],"names":[],"mappings":"AAgBA,MAAM,UAAU,GAAG,yBAAyB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/link-health/index.ts"],"names":[],"mappings":"AAgBA,MAAM,UAAU,GAAG,yBAAyB,CAAA;AAE5C,4DAA4D;AAC5D,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,OAAe,EACf,OAAe;IAEf,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IACvC,MAAM,OAAO,GAAuB,EAAE,CAAA;IACtC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,IAAI,KAA6B,CAAA;IAEjC,OAA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],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/og-image/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,yEAAyE;AACzE,wBAAsB,eAAe,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC,CAqBhF"}
|
package/dist/og-image/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/** Generates an Open Graph image response compatible with @vercel/og. */
|
|
2
2
|
export async function generateOGImage(options) {
|
|
3
|
-
const { title, description, siteName, theme =
|
|
4
|
-
const bg = theme ===
|
|
5
|
-
const fg = theme ===
|
|
6
|
-
const muted = theme ===
|
|
3
|
+
const { title, description, siteName, theme = 'light' } = options;
|
|
4
|
+
const bg = theme === 'dark' ? '#0a0a0a' : '#ffffff';
|
|
5
|
+
const fg = theme === 'dark' ? '#fafafa' : '#0a0a0a';
|
|
6
|
+
const muted = theme === 'dark' ? '#a1a1aa' : '#71717a';
|
|
7
7
|
const html = `
|
|
8
8
|
<div style="display:flex;flex-direction:column;justify-content:flex-end;width:1200px;height:630px;padding:60px;background:${bg};font-family:system-ui,sans-serif;">
|
|
9
|
-
${siteName ? `<div style="color:${muted};font-size:24px;margin-bottom:16px;">${escapeHtml(siteName)}</div>` :
|
|
9
|
+
${siteName ? `<div style="color:${muted};font-size:24px;margin-bottom:16px;">${escapeHtml(siteName)}</div>` : ''}
|
|
10
10
|
<div style="color:${fg};font-size:${options.fontSize ?? 56}px;font-weight:700;line-height:1.2;max-width:900px;overflow:hidden;text-overflow:ellipsis;">${escapeHtml(title)}</div>
|
|
11
|
-
${description ? `<div style="color:${muted};font-size:28px;margin-top:20px;max-width:800px;overflow:hidden;text-overflow:ellipsis;">${escapeHtml(description)}</div>` :
|
|
11
|
+
${description ? `<div style="color:${muted};font-size:28px;margin-top:20px;max-width:800px;overflow:hidden;text-overflow:ellipsis;">${escapeHtml(description)}</div>` : ''}
|
|
12
12
|
</div>
|
|
13
13
|
`;
|
|
14
14
|
return new Response(html, {
|
|
15
15
|
headers: {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
'Content-Type': 'text/html',
|
|
17
|
+
'Cache-Control': 'public, max-age=86400, s-maxage=86400',
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
function escapeHtml(str) {
|
|
22
22
|
return str
|
|
23
|
-
.replace(/&/g,
|
|
24
|
-
.replace(/</g,
|
|
25
|
-
.replace(/>/g,
|
|
26
|
-
.replace(/"/g,
|
|
23
|
+
.replace(/&/g, '&')
|
|
24
|
+
.replace(/</g, '<')
|
|
25
|
+
.replace(/>/g, '>')
|
|
26
|
+
.replace(/"/g, '"');
|
|
27
27
|
}
|
|
28
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/og-image/index.ts"],"names":[],"mappings":"AASA,yEAAyE;AACzE,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAuB;IAC3D,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,GAAG,OAAO,EAAE,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/og-image/index.ts"],"names":[],"mappings":"AASA,yEAAyE;AACzE,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAuB;IAC3D,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,GAA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"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/robots/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC;QACZ,SAAS,EAAE,MAAM,CAAA;QACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;QAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;QACnB,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB,CAAC,CAAA;IACF,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC5B;AAaD,kEAAkE;AAClE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAsC9D"}
|
package/dist/robots/index.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
const DEFAULT_AI_BOTS = [
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
'GPTBot',
|
|
3
|
+
'ChatGPT-User',
|
|
4
|
+
'ClaudeBot',
|
|
5
|
+
'Claude-Web',
|
|
6
|
+
'anthropic-ai',
|
|
7
|
+
'Bytespider',
|
|
8
|
+
'CCBot',
|
|
9
|
+
'Google-Extended',
|
|
10
10
|
];
|
|
11
11
|
/** Generates a robots.txt string from the given configuration. */
|
|
12
12
|
export function generateRobotsTxt(config) {
|
|
13
13
|
const lines = [];
|
|
14
|
-
const rules = config.rules ?? [
|
|
15
|
-
{ userAgent: "*", allow: ["/"], disallow: ["/admin", "/api/"] },
|
|
16
|
-
];
|
|
14
|
+
const rules = config.rules ?? [{ userAgent: '*', allow: ['/'], disallow: ['/admin', '/api/'] }];
|
|
17
15
|
for (const rule of rules) {
|
|
18
16
|
lines.push(`User-agent: ${rule.userAgent}`);
|
|
19
17
|
if (rule.allow) {
|
|
@@ -29,20 +27,20 @@ export function generateRobotsTxt(config) {
|
|
|
29
27
|
if (rule.crawlDelay !== undefined) {
|
|
30
28
|
lines.push(`Crawl-delay: ${rule.crawlDelay}`);
|
|
31
29
|
}
|
|
32
|
-
lines.push(
|
|
30
|
+
lines.push('');
|
|
33
31
|
}
|
|
34
32
|
if (config.blockAIBots) {
|
|
35
33
|
const bots = [...DEFAULT_AI_BOTS, ...(config.additionalAIBots ?? [])];
|
|
36
34
|
for (const bot of bots) {
|
|
37
35
|
lines.push(`User-agent: ${bot}`);
|
|
38
|
-
lines.push(
|
|
39
|
-
lines.push(
|
|
36
|
+
lines.push('Disallow: /');
|
|
37
|
+
lines.push('');
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
40
|
if (config.sitemapUrl) {
|
|
43
41
|
lines.push(`Sitemap: ${config.sitemapUrl}`);
|
|
44
|
-
lines.push(
|
|
42
|
+
lines.push('');
|
|
45
43
|
}
|
|
46
|
-
return lines.join(
|
|
44
|
+
return lines.join('\n');
|
|
47
45
|
}
|
|
48
46
|
//# sourceMappingURL=index.js.map
|
package/dist/robots/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/robots/index.ts"],"names":[],"mappings":"AAYA,MAAM,eAAe,GAAG;IACtB,QAAQ;IACR,cAAc;IACd,WAAW;IACX,YAAY;IACZ,cAAc;IACd,YAAY;IACZ,OAAO;IACP,iBAAiB;CAClB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/robots/index.ts"],"names":[],"mappings":"AAYA,MAAM,eAAe,GAAG;IACtB,QAAQ;IACR,cAAc;IACd,WAAW;IACX,YAAY;IACZ,cAAc;IACd,YAAY;IACZ,OAAO;IACP,iBAAiB;CAClB,CAAA;AAED,kEAAkE;AAClE,MAAM,UAAU,iBAAiB,CAAC,MAAoB;IACpD,MAAM,KAAK,GAAa,EAAE,CAAA;IAE1B,MAAM,KAAK,GAAG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AAC;IAED,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACtB,KAAK,CAAC,IAAI,CAAC,YAAY,MAAM,CAAC,UAAU,EAAE,CAAC,CAAA;QAC3C,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAChB,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export
|
|
1
|
+
/** Re-export cms-core schema detection so plugin and runtime paths stay aligned. */
|
|
2
|
+
export { detectSchemaType } from '@actuate-media/cms-core';
|
|
3
3
|
//# sourceMappingURL=auto-detect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-detect.d.ts","sourceRoot":"","sources":["../../src/schema/auto-detect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auto-detect.d.ts","sourceRoot":"","sources":["../../src/schema/auto-detect.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
blog: "Article",
|
|
4
|
-
articles: "Article",
|
|
5
|
-
pages: "WebPage",
|
|
6
|
-
team: "Person",
|
|
7
|
-
staff: "Person",
|
|
8
|
-
events: "Event",
|
|
9
|
-
faq: "FAQPage",
|
|
10
|
-
services: "Service",
|
|
11
|
-
jobs: "JobPosting",
|
|
12
|
-
locations: "LocalBusiness",
|
|
13
|
-
testimonials: "Review",
|
|
14
|
-
};
|
|
15
|
-
/** Maps a collection slug to the most appropriate Schema.org type. */
|
|
16
|
-
export function detectSchemaType(collectionSlug) {
|
|
17
|
-
const normalized = collectionSlug.toLowerCase().replace(/[^a-z]/g, "");
|
|
18
|
-
if (SLUG_TO_SCHEMA[normalized]) {
|
|
19
|
-
return SLUG_TO_SCHEMA[normalized];
|
|
20
|
-
}
|
|
21
|
-
for (const [key, schemaType] of Object.entries(SLUG_TO_SCHEMA)) {
|
|
22
|
-
if (normalized.includes(key) || key.includes(normalized)) {
|
|
23
|
-
return schemaType;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return "WebPage";
|
|
27
|
-
}
|
|
1
|
+
/** Re-export cms-core schema detection so plugin and runtime paths stay aligned. */
|
|
2
|
+
export { detectSchemaType } from '@actuate-media/cms-core';
|
|
28
3
|
//# sourceMappingURL=auto-detect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-detect.js","sourceRoot":"","sources":["../../src/schema/auto-detect.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"auto-detect.js","sourceRoot":"","sources":["../../src/schema/auto-detect.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composer.d.ts","sourceRoot":"","sources":["../../src/schema/composer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"composer.d.ts","sourceRoot":"","sources":["../../src/schema/composer.ts"],"names":[],"mappings":"AAsBA,oFAAoF;AACpF,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA2CzB"}
|