Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7572ec0c04 | ||
|
|
a24777b915 |
Vendored
+55
-54
@@ -1,73 +1,74 @@
|
|||||||
export { ipalKit } from './plugin.js';
|
|
||||||
export type { IpalOptions } from './types.js';
|
|
||||||
export type { I18nConfig, LocaleDefinition, LocalizedSlugs } from './modules/i18n/index.js';
|
|
||||||
export { buildLocalizedPath, getDefaultLocale, getLocaleCodes, getLocaleDefinition, getLocalizedSlugs, isValidLocale, LOCALE_COOKIE_NAME, matchAcceptLanguage, negotiateLocale, switchLocalePath, } from './modules/i18n/index.js';
|
|
||||||
export type { PagesOption, SystemPageRole } from './modules/pages/index.js';
|
|
||||||
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js';
|
|
||||||
export type { AccessOption, Role } from './modules/access/index.js';
|
export type { AccessOption, Role } from './modules/access/index.js';
|
||||||
export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, hasMinimumRole, isAdmin, isEditor, requireRole, requireRoleField, ROLE_HIERARCHY, } from './modules/access/index.js';
|
export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, hasMinimumRole, isAdmin, isEditor, requireRole, requireRoleField, ROLE_HIERARCHY, } from './modules/access/index.js';
|
||||||
export type { GlobalQueryOptions } from './modules/payload/index.js';
|
export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js';
|
||||||
export { getGlobal, getSiteSettings, getSiteIntegrations, SITE_SETTINGS_SLUG, SITE_INTEGRATIONS_SLUG, } from './modules/payload/index.js';
|
export type { A11yState } from './modules/accessibility/index.js';
|
||||||
export type { SeoOption, SeoMeta, PageMetadata } from './modules/seo/index.js';
|
export { rowLabel } from './modules/admin-ui/index.js';
|
||||||
export { composeTitle, buildHreflangAlternates, buildMetadata, readSiteMetaConfig, slugsAcrossLocales, } from './modules/seo/index.js';
|
export type { RowLabelProps } from './modules/admin-ui/index.js';
|
||||||
export type { SiteMetaConfig } from './modules/seo/index.js';
|
export type { AnalyticsConfig } from './modules/analytics/index.js';
|
||||||
export type { ContentOption, ContentCollectionOption, ResolvedRoute } from './modules/content/index.js';
|
export { getAnalyticsConfig } from './modules/analytics/index.js';
|
||||||
export { createContentHelpers } from './modules/frontend/index.js';
|
export { ACCEPT_ALL_CONSENT, CONSENT_CATEGORIES, CONSENT_COOKIE, CONSENT_MAX_AGE, CONSENT_VERSION, DEFAULT_CONSENT, getConsentTexts, parseConsent, REJECT_ALL_CONSENT, serializeConsent, setDefaultConsent, updateConsent, } from './modules/consent/index.js';
|
||||||
export { resolveRoute, resolveRedirect, resolveNotFoundPage, blocksToMarkdown, createMarkdownRenderer, markdownResponse, prefersMarkdown, markdownHref, MARKDOWN_PREFIX, searchContent, createSearchRoute, archiveFieldName, getArchiveEntries, buildArchivePath, buildEntryPath, parsePageParam, } from './modules/content/index.js';
|
export type { ConsentCategory, ConsentState, ConsentTexts } from './modules/consent/index.js';
|
||||||
|
export type { ContentCollectionOption, ContentOption, ResolvedRoute } from './modules/content/index.js';
|
||||||
|
export { archiveFieldName, blocksToMarkdown, buildArchivePath, buildEntryPath, createMarkdownRenderer, createSearchRoute, getArchiveEntries, MARKDOWN_PREFIX, markdownHref, markdownResponse, parsePageParam, prefersMarkdown, resolveNotFoundPage, resolveRedirect, resolveRoute, searchContent, } from './modules/content/index.js';
|
||||||
export type { ArchiveEntries } from './modules/content/index.js';
|
export type { ArchiveEntries } from './modules/content/index.js';
|
||||||
export type { SearchResult } from './modules/content/index.js';
|
export type { SearchResult } from './modules/content/index.js';
|
||||||
export { lexicalToMarkdown } from './modules/richtext/index.js';
|
export { graphAdapter } from './modules/email/graphAdapter.js';
|
||||||
export type { AutoFillMapping, SitemapEntry, RobotsRules, RobotsOptions } from './modules/seo/index.js';
|
export type { GraphAdapterArgs } from './modules/email/graphAdapter.js';
|
||||||
export { buildAutoFillMetaHook, injectAutoFillMeta, createMetadataGenerator, createPageMetadata, buildSitemapEntries, buildRobots, AI_ASSISTANT_BOTS, AI_TRAINING_BOTS, } from './modules/seo/index.js';
|
export { mailAdapter } from './modules/email/mailAdapter.js';
|
||||||
|
export type { MailAdapterArgs } from './modules/email/mailAdapter.js';
|
||||||
|
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js';
|
||||||
|
export type { PanelSmtpAdapterArgs } from './modules/email/panelSmtpAdapter.js';
|
||||||
|
export { assertEnv, ipalEnvRules } from './modules/env/index.js';
|
||||||
|
export type { AssertEnvOptions, EnvKind, EnvRule, IpalEnvFeatures } from './modules/env/index.js';
|
||||||
|
export { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js';
|
||||||
|
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js';
|
||||||
|
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js';
|
||||||
|
export type { FormsCollectionOverrides, FormsFieldsOverride, FormsOption, } from './modules/forms/types.js';
|
||||||
|
export type { FormErrors, FormSubmitAction, Validator } from './modules/forms/useForm.js';
|
||||||
|
export { buildValidator, checked, custom, email, isEmail, maxLength, minLength, pattern, required, } from './modules/forms/validators.js';
|
||||||
|
export type { Rule } from './modules/forms/validators.js';
|
||||||
|
export { createContentHelpers } from './modules/frontend/index.js';
|
||||||
|
export { createHealthRoute } from './modules/health/index.js';
|
||||||
|
export { buildCrossLocaleFieldSync, buildPreventDeleteSystemPage, buildRevalidateHook, buildValidateUniqueRole, setPublishedAtHook, trackSlugHistoryHook } from './modules/hooks/index.js';
|
||||||
|
export type { I18nConfig, LocaleDefinition, LocalizedSlugs } from './modules/i18n/index.js';
|
||||||
|
export { buildLocalizedPath, getDefaultLocale, getLocaleCodes, getLocaleDefinition, getLocalizedSlugs, isValidLocale, LOCALE_COOKIE_NAME, matchAcceptLanguage, negotiateLocale, switchLocalePath, } from './modules/i18n/index.js';
|
||||||
export type { LocaleMiddlewareResult } from './modules/i18n/index.js';
|
export type { LocaleMiddlewareResult } from './modules/i18n/index.js';
|
||||||
export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER, } from './modules/i18n/index.js';
|
export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER, } from './modules/i18n/index.js';
|
||||||
export { createProxy, DEFAULT_PROXY_MATCHER } from './modules/i18n/index.js';
|
export { createProxy, DEFAULT_PROXY_MATCHER } from './modules/i18n/index.js';
|
||||||
export { resolveLocalized } from './modules/i18n/index.js';
|
export { resolveLocalized } from './modules/i18n/index.js';
|
||||||
export { CONSENT_CATEGORIES, DEFAULT_CONSENT, ACCEPT_ALL_CONSENT, REJECT_ALL_CONSENT, CONSENT_COOKIE, CONSENT_VERSION, CONSENT_MAX_AGE, serializeConsent, parseConsent, setDefaultConsent, updateConsent, getConsentTexts, } from './modules/consent/index.js';
|
export { buildLinkField, buildLinksField, resolveLinkHref } from './modules/links/index.js';
|
||||||
export type { ConsentCategory, ConsentState, ConsentTexts } from './modules/consent/index.js';
|
export type { BuildLinkFieldOptions, BuildLinksFieldOptions, LinkAppearance, LinkValue, ResolveLinkHrefOptions, } from './modules/links/index.js';
|
||||||
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js';
|
|
||||||
export { graphAdapter } from './modules/email/graphAdapter.js';
|
|
||||||
export { mailAdapter } from './modules/email/mailAdapter.js';
|
|
||||||
export type { MailAdapterArgs } from './modules/email/mailAdapter.js';
|
|
||||||
export type { GraphAdapterArgs } from './modules/email/graphAdapter.js';
|
|
||||||
export type { PanelSmtpAdapterArgs } from './modules/email/panelSmtpAdapter.js';
|
|
||||||
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js';
|
|
||||||
export type { FormsOption, FormsCollectionOverrides, FormsFieldsOverride, } from './modules/forms/types.js';
|
|
||||||
export { buildValidator, isEmail, required, email, minLength, maxLength, checked, pattern, custom, } from './modules/forms/validators.js';
|
|
||||||
export type { Rule } from './modules/forms/validators.js';
|
|
||||||
export type { FormErrors, FormSubmitAction, Validator } from './modules/forms/useForm.js';
|
|
||||||
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js';
|
|
||||||
export { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js';
|
|
||||||
export { createHealthRoute } from './modules/health/index.js';
|
|
||||||
export { createMcpRoute } from './modules/mcp/index.js';
|
export { createMcpRoute } from './modules/mcp/index.js';
|
||||||
export { assertEnv, ipalEnvRules } from './modules/env/index.js';
|
export { buildOptimizeUploadField, buildOptimizeUploadHook, normalizeFilename, normalizeFilenameHook } from './modules/media/index.js';
|
||||||
export type { EnvRule, EnvKind, AssertEnvOptions, IpalEnvFeatures } from './modules/env/index.js';
|
export type { OptimizeUploadOptions } from './modules/media/index.js';
|
||||||
export type { AnalyticsConfig } from './modules/analytics/index.js';
|
export { getNotificationTexts, NOTIFICATION_FALLBACK, resolveFormMessage } from './modules/notifications/index.js';
|
||||||
export { getAnalyticsConfig } from './modules/analytics/index.js';
|
export type { FormNotificationTexts, NotificationTexts } from './modules/notifications/index.js';
|
||||||
export { buildSlugField, toSlug } from './modules/slug/index.js';
|
export type { PagesOption, SystemPageRole } from './modules/pages/index.js';
|
||||||
export { createLlmsTxtRoute, createSitemapRouteHandler, createManifestHandler } from './modules/seo/index.js';
|
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js';
|
||||||
export { getNotificationTexts, resolveFormMessage, NOTIFICATION_FALLBACK } from './modules/notifications/index.js';
|
export type { GlobalQueryOptions } from './modules/payload/index.js';
|
||||||
|
export { getGlobal, getSiteIntegrations, getSiteSettings, SITE_INTEGRATIONS_SLUG, SITE_SETTINGS_SLUG, } from './modules/payload/index.js';
|
||||||
|
export { lexicalToMarkdown } from './modules/richtext/index.js';
|
||||||
export { buildSecurityHeaders } from './modules/security/index.js';
|
export { buildSecurityHeaders } from './modules/security/index.js';
|
||||||
export { buildCsp } from './modules/security/index.js';
|
export { buildCsp } from './modules/security/index.js';
|
||||||
export type { BuildCspArgs } from './modules/security/index.js';
|
export type { BuildCspArgs } from './modules/security/index.js';
|
||||||
|
export type { BuildSecurityHeadersArgs, SecurityHeader } from './modules/security/index.js';
|
||||||
|
export type { PageMetadata, SeoMeta, SeoOption } from './modules/seo/index.js';
|
||||||
|
export { buildHreflangAlternates, buildMetadata, composeTitle, readSiteMetaConfig, slugsAcrossLocales, } from './modules/seo/index.js';
|
||||||
|
export type { SiteMetaConfig } from './modules/seo/index.js';
|
||||||
|
export type { AutoFillMapping, RobotsOptions, RobotsRules, SitemapEntry } from './modules/seo/index.js';
|
||||||
|
export { AI_ASSISTANT_BOTS, AI_TRAINING_BOTS, buildAutoFillMetaHook, buildRobots, buildSitemapEntries, createMetadataGenerator, createPageMetadata, injectAutoFillMeta, } from './modules/seo/index.js';
|
||||||
|
export { createLlmsTxtRoute, createManifestHandler, createSitemapRouteHandler } from './modules/seo/index.js';
|
||||||
export { buildIconsMetadata, buildOrganizationJsonLd, validateFaviconField } from './modules/seo/index.js';
|
export { buildIconsMetadata, buildOrganizationJsonLd, validateFaviconField } from './modules/seo/index.js';
|
||||||
export { buildNoindexField } from './modules/seo/index.js';
|
export { buildNoindexField } from './modules/seo/index.js';
|
||||||
export { rowLabel } from './modules/admin-ui/index.js';
|
|
||||||
export type { RowLabelProps } from './modules/admin-ui/index.js';
|
|
||||||
export { buildLinkField, buildLinksField, resolveLinkHref } from './modules/links/index.js';
|
|
||||||
export type { LinkAppearance, LinkValue, BuildLinkFieldOptions, BuildLinksFieldOptions, ResolveLinkHrefOptions, } from './modules/links/index.js';
|
|
||||||
export { buildSpeakableJsonLd } from './modules/seo/index.js';
|
export { buildSpeakableJsonLd } from './modules/seo/index.js';
|
||||||
export { buildSummaryField } from './modules/seo/index.js';
|
export { buildSummaryField } from './modules/seo/index.js';
|
||||||
export { buildWebSiteJsonLd, buildBreadcrumbJsonLd, buildSiteNavigationJsonLd } from './modules/seo/index.js';
|
export { buildBreadcrumbJsonLd, buildSiteNavigationJsonLd, buildWebSiteJsonLd } from './modules/seo/index.js';
|
||||||
export { buildLocalBusinessJsonLd, buildFaqJsonLd, buildServiceJsonLd } from './modules/seo/index.js';
|
export { buildFaqJsonLd, buildLocalBusinessJsonLd, buildServiceJsonLd } from './modules/seo/index.js';
|
||||||
export { buildArticleJsonLd } from './modules/seo/index.js';
|
export { buildArticleJsonLd } from './modules/seo/index.js';
|
||||||
export { buildLlmsTxt } from './modules/seo/index.js';
|
export { buildLlmsTxt } from './modules/seo/index.js';
|
||||||
export { buildSitemapXml } from './modules/seo/index.js';
|
export { buildSitemapCss, buildSitemapXml, DEFAULT_SITEMAP_CREDIT, SITEMAP_STYLE_PARAM } from './modules/seo/index.js';
|
||||||
|
export type { SitemapRouteOptions, SitemapStyleOptions } from './modules/seo/index.js';
|
||||||
|
export { buildSlugField, toSlug } from './modules/slug/index.js';
|
||||||
export { buildR2Storage } from './modules/storage/index.js';
|
export { buildR2Storage } from './modules/storage/index.js';
|
||||||
export { normalizeFilename, normalizeFilenameHook, buildOptimizeUploadHook, buildOptimizeUploadField } from './modules/media/index.js';
|
export { ipalKit } from './plugin.js';
|
||||||
export type { OptimizeUploadOptions } from './modules/media/index.js';
|
export type { IpalOptions } from './types.js';
|
||||||
export { buildRevalidateHook, setPublishedAtHook, buildPreventDeleteSystemPage, buildValidateUniqueRole, trackSlugHistoryHook, buildCrossLocaleFieldSync } from './modules/hooks/index.js';
|
|
||||||
export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js';
|
|
||||||
export type { A11yState } from './modules/accessibility/index.js';
|
|
||||||
export type { SecurityHeader, BuildSecurityHeadersArgs } from './modules/security/index.js';
|
|
||||||
export type { NotificationTexts, FormNotificationTexts } from './modules/notifications/index.js';
|
|
||||||
|
|||||||
Vendored
+34
-34
@@ -1,59 +1,59 @@
|
|||||||
export { ipalKit } from './plugin.js';
|
|
||||||
export { buildLocalizedPath, getDefaultLocale, getLocaleCodes, getLocaleDefinition, getLocalizedSlugs, isValidLocale, LOCALE_COOKIE_NAME, matchAcceptLanguage, negotiateLocale, switchLocalePath } from './modules/i18n/index.js';
|
|
||||||
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js';
|
|
||||||
export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, hasMinimumRole, isAdmin, isEditor, requireRole, requireRoleField, ROLE_HIERARCHY } from './modules/access/index.js';
|
export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, hasMinimumRole, isAdmin, isEditor, requireRole, requireRoleField, ROLE_HIERARCHY } from './modules/access/index.js';
|
||||||
export { getGlobal, getSiteSettings, getSiteIntegrations, SITE_SETTINGS_SLUG, SITE_INTEGRATIONS_SLUG } from './modules/payload/index.js';
|
export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js';
|
||||||
export { composeTitle, buildHreflangAlternates, buildMetadata, readSiteMetaConfig, slugsAcrossLocales } from './modules/seo/index.js';
|
export { rowLabel } from './modules/admin-ui/index.js';
|
||||||
export { createContentHelpers } from './modules/frontend/index.js';
|
export { getAnalyticsConfig } from './modules/analytics/index.js';
|
||||||
export { resolveRoute, resolveRedirect, resolveNotFoundPage, blocksToMarkdown, createMarkdownRenderer, markdownResponse, prefersMarkdown, markdownHref, MARKDOWN_PREFIX, searchContent, createSearchRoute, archiveFieldName, getArchiveEntries, buildArchivePath, buildEntryPath, parsePageParam } from './modules/content/index.js';
|
export { ACCEPT_ALL_CONSENT, CONSENT_CATEGORIES, CONSENT_COOKIE, CONSENT_MAX_AGE, CONSENT_VERSION, DEFAULT_CONSENT, getConsentTexts, parseConsent, REJECT_ALL_CONSENT, serializeConsent, setDefaultConsent, updateConsent } from './modules/consent/index.js';
|
||||||
// Lexical → Markdown (pure, no React) — for AI-readable output.
|
export { archiveFieldName, blocksToMarkdown, buildArchivePath, buildEntryPath, createMarkdownRenderer, createSearchRoute, getArchiveEntries, MARKDOWN_PREFIX, markdownHref, markdownResponse, parsePageParam, prefersMarkdown, resolveNotFoundPage, resolveRedirect, resolveRoute, searchContent } from './modules/content/index.js';
|
||||||
export { lexicalToMarkdown } from './modules/richtext/index.js';
|
export { graphAdapter } from './modules/email/graphAdapter.js';
|
||||||
export { buildAutoFillMetaHook, injectAutoFillMeta, createMetadataGenerator, createPageMetadata, buildSitemapEntries, buildRobots, AI_ASSISTANT_BOTS, AI_TRAINING_BOTS } from './modules/seo/index.js';
|
export { mailAdapter } from './modules/email/mailAdapter.js';
|
||||||
export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from './modules/i18n/index.js';
|
|
||||||
export { createProxy, DEFAULT_PROXY_MATCHER } from './modules/i18n/index.js';
|
|
||||||
export { resolveLocalized } from './modules/i18n/index.js';
|
|
||||||
export { CONSENT_CATEGORIES, DEFAULT_CONSENT, ACCEPT_ALL_CONSENT, REJECT_ALL_CONSENT, CONSENT_COOKIE, CONSENT_VERSION, CONSENT_MAX_AGE, serializeConsent, parseConsent, setDefaultConsent, updateConsent, getConsentTexts } from './modules/consent/index.js';
|
|
||||||
// Imported straight from the file, NOT from ./modules/email/index.js — that
|
// Imported straight from the file, NOT from ./modules/email/index.js — that
|
||||||
// barrel re-exports sendEmail, which imports 'server-only' and would crash when
|
// barrel re-exports sendEmail, which imports 'server-only' and would crash when
|
||||||
// Payload loads the config (or runs generate:importmap) as a plain Node script.
|
// Payload loads the config (or runs generate:importmap) as a plain Node script.
|
||||||
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js';
|
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js';
|
||||||
export { graphAdapter } from './modules/email/graphAdapter.js';
|
// Boot-time environment validation (fail fast on misconfigured deploys).
|
||||||
export { mailAdapter } from './modules/email/mailAdapter.js';
|
export { assertEnv, ipalEnvRules } from './modules/env/index.js';
|
||||||
|
// Panel-managed form analytics (config-time field builder).
|
||||||
|
export { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js';
|
||||||
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js';
|
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js';
|
||||||
|
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js';
|
||||||
// Validation rules are pure — exported server-side too, for re-validating a
|
// Validation rules are pure — exported server-side too, for re-validating a
|
||||||
// submission inside a server action. (useForm/useContactForm are client-only →
|
// submission inside a server action. (useForm/useContactForm are client-only →
|
||||||
// '@intecion/ipal-kit/client'.)
|
// '@intecion/ipal-kit/client'.)
|
||||||
export { buildValidator, isEmail, required, email, minLength, maxLength, checked, pattern, custom } from './modules/forms/validators.js';
|
export { buildValidator, checked, custom, email, isEmail, maxLength, minLength, pattern, required } from './modules/forms/validators.js';
|
||||||
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js';
|
export { createContentHelpers } from './modules/frontend/index.js';
|
||||||
// Panel-managed form analytics (config-time field builder).
|
|
||||||
export { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js';
|
|
||||||
// Healthcheck route (Coolify/Docker liveness with a real DB round-trip).
|
// Healthcheck route (Coolify/Docker liveness with a real DB round-trip).
|
||||||
export { createHealthRoute } from './modules/health/index.js';
|
export { createHealthRoute } from './modules/health/index.js';
|
||||||
|
export { buildCrossLocaleFieldSync, buildPreventDeleteSystemPage, buildRevalidateHook, buildValidateUniqueRole, setPublishedAtHook, trackSlugHistoryHook } from './modules/hooks/index.js';
|
||||||
|
export { buildLocalizedPath, getDefaultLocale, getLocaleCodes, getLocaleDefinition, getLocalizedSlugs, isValidLocale, LOCALE_COOKIE_NAME, matchAcceptLanguage, negotiateLocale, switchLocalePath } from './modules/i18n/index.js';
|
||||||
|
export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from './modules/i18n/index.js';
|
||||||
|
export { createProxy, DEFAULT_PROXY_MATCHER } from './modules/i18n/index.js';
|
||||||
|
export { resolveLocalized } from './modules/i18n/index.js';
|
||||||
|
export { buildLinkField, buildLinksField, resolveLinkHref } from './modules/links/index.js';
|
||||||
// Read-only MCP server (Claude/agents connect to the site and query it).
|
// Read-only MCP server (Claude/agents connect to the site and query it).
|
||||||
export { createMcpRoute } from './modules/mcp/index.js';
|
export { createMcpRoute } from './modules/mcp/index.js';
|
||||||
// Boot-time environment validation (fail fast on misconfigured deploys).
|
export { buildOptimizeUploadField, buildOptimizeUploadHook, normalizeFilename, normalizeFilenameHook } from './modules/media/index.js';
|
||||||
export { assertEnv, ipalEnvRules } from './modules/env/index.js';
|
export { getNotificationTexts, NOTIFICATION_FALLBACK, resolveFormMessage } from './modules/notifications/index.js';
|
||||||
export { getAnalyticsConfig } from './modules/analytics/index.js';
|
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js';
|
||||||
export { buildSlugField, toSlug } from './modules/slug/index.js';
|
export { getGlobal, getSiteIntegrations, getSiteSettings, SITE_INTEGRATIONS_SLUG, SITE_SETTINGS_SLUG } from './modules/payload/index.js';
|
||||||
export { createLlmsTxtRoute, createSitemapRouteHandler, createManifestHandler } from './modules/seo/index.js';
|
// Lexical → Markdown (pure, no React) — for AI-readable output.
|
||||||
export { getNotificationTexts, resolveFormMessage, NOTIFICATION_FALLBACK } from './modules/notifications/index.js';
|
export { lexicalToMarkdown } from './modules/richtext/index.js';
|
||||||
export { buildSecurityHeaders } from './modules/security/index.js';
|
export { buildSecurityHeaders } from './modules/security/index.js';
|
||||||
export { buildCsp } from './modules/security/index.js';
|
export { buildCsp } from './modules/security/index.js';
|
||||||
|
export { buildHreflangAlternates, buildMetadata, composeTitle, readSiteMetaConfig, slugsAcrossLocales } from './modules/seo/index.js';
|
||||||
|
export { AI_ASSISTANT_BOTS, AI_TRAINING_BOTS, buildAutoFillMetaHook, buildRobots, buildSitemapEntries, createMetadataGenerator, createPageMetadata, injectAutoFillMeta } from './modules/seo/index.js';
|
||||||
|
export { createLlmsTxtRoute, createManifestHandler, createSitemapRouteHandler } from './modules/seo/index.js';
|
||||||
export { buildIconsMetadata, buildOrganizationJsonLd, validateFaviconField } from './modules/seo/index.js';
|
export { buildIconsMetadata, buildOrganizationJsonLd, validateFaviconField } from './modules/seo/index.js';
|
||||||
export { buildNoindexField } from './modules/seo/index.js';
|
export { buildNoindexField } from './modules/seo/index.js';
|
||||||
export { rowLabel } from './modules/admin-ui/index.js';
|
|
||||||
export { buildLinkField, buildLinksField, resolveLinkHref } from './modules/links/index.js';
|
|
||||||
export { buildSpeakableJsonLd } from './modules/seo/index.js';
|
export { buildSpeakableJsonLd } from './modules/seo/index.js';
|
||||||
export { buildSummaryField } from './modules/seo/index.js';
|
export { buildSummaryField } from './modules/seo/index.js';
|
||||||
export { buildWebSiteJsonLd, buildBreadcrumbJsonLd, buildSiteNavigationJsonLd } from './modules/seo/index.js';
|
export { buildBreadcrumbJsonLd, buildSiteNavigationJsonLd, buildWebSiteJsonLd } from './modules/seo/index.js';
|
||||||
// Local SEO structured data — LocalBusiness (map pack), Service (offering), FAQPage.
|
// Local SEO structured data — LocalBusiness (map pack), Service (offering), FAQPage.
|
||||||
export { buildLocalBusinessJsonLd, buildFaqJsonLd, buildServiceJsonLd } from './modules/seo/index.js';
|
export { buildFaqJsonLd, buildLocalBusinessJsonLd, buildServiceJsonLd } from './modules/seo/index.js';
|
||||||
export { buildArticleJsonLd } from './modules/seo/index.js';
|
export { buildArticleJsonLd } from './modules/seo/index.js';
|
||||||
export { buildLlmsTxt } from './modules/seo/index.js';
|
export { buildLlmsTxt } from './modules/seo/index.js';
|
||||||
export { buildSitemapXml } from './modules/seo/index.js';
|
export { buildSitemapCss, buildSitemapXml, DEFAULT_SITEMAP_CREDIT, SITEMAP_STYLE_PARAM } from './modules/seo/index.js';
|
||||||
|
export { buildSlugField, toSlug } from './modules/slug/index.js';
|
||||||
export { buildR2Storage } from './modules/storage/index.js';
|
export { buildR2Storage } from './modules/storage/index.js';
|
||||||
export { normalizeFilename, normalizeFilenameHook, buildOptimizeUploadHook, buildOptimizeUploadField } from './modules/media/index.js';
|
export { ipalKit } from './plugin.js';
|
||||||
export { buildRevalidateHook, setPublishedAtHook, buildPreventDeleteSystemPage, buildValidateUniqueRole, trackSlugHistoryHook, buildCrossLocaleFieldSync } from './modules/hooks/index.js';
|
|
||||||
export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js';
|
|
||||||
|
|
||||||
//# sourceMappingURL=index.js.map
|
//# sourceMappingURL=index.js.map
|
||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+13
-2
@@ -1,7 +1,7 @@
|
|||||||
import type { BasePayload, SanitizedConfig } from 'payload';
|
import type { BasePayload, SanitizedConfig } from 'payload';
|
||||||
import type { ArchiveEntries, ContentOption, ResolvedRoute } from '../content/index.js';
|
import type { ArchiveEntries, ContentOption, ResolvedRoute } from '../content/index.js';
|
||||||
import type { I18nConfig } from '../i18n/index.js';
|
import type { I18nConfig } from '../i18n/index.js';
|
||||||
import type { PageMetadata, RobotsOptions, RobotsRules, SitemapEntry } from '../seo/index.js';
|
import type { PageMetadata, RobotsOptions, RobotsRules, SitemapEntry, SitemapStyleOptions } from '../seo/index.js';
|
||||||
type CreateContentHelpersArgs = {
|
type CreateContentHelpersArgs = {
|
||||||
/**
|
/**
|
||||||
* Absolute site origin for sitemap/robots URLs. Falls back to
|
* Absolute site origin for sitemap/robots URLs. Falls back to
|
||||||
@@ -31,6 +31,16 @@ type CreateContentHelpersArgs = {
|
|||||||
robots?: RobotsOptions;
|
robots?: RobotsOptions;
|
||||||
/** SiteSettings global slug. Defaults to 'site-settings'. */
|
/** SiteSettings global slug. Defaults to 'site-settings'. */
|
||||||
settingsSlug?: string;
|
settingsSlug?: string;
|
||||||
|
/**
|
||||||
|
* Browser look of `sitemapRoute` (/sitemap.xml). Default: built-in style,
|
||||||
|
* header = Site Settings `siteName` (default locale), credit "Technology by
|
||||||
|
* Intecion.com". `false` = raw XML. `{ credit: false }` hides the credit line.
|
||||||
|
*/
|
||||||
|
sitemapStyle?: {
|
||||||
|
title?: string;
|
||||||
|
} & Omit<SitemapStyleOptions, 'title'> | false;
|
||||||
|
/** Site Settings field with the site name (sitemap header). Default 'siteName'. */
|
||||||
|
siteNameField?: string;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* Bundles the per-request data helpers a frontend needs — the same cached
|
* Bundles the per-request data helpers a frontend needs — the same cached
|
||||||
@@ -58,7 +68,7 @@ type CreateContentHelpersArgs = {
|
|||||||
* a URL is, fetching gets the listing. Metadata generation needs the first and
|
* a URL is, fetching gets the listing. Metadata generation needs the first and
|
||||||
* not the second, and a page component composes them in two obvious lines.
|
* not the second, and a page component composes them in two obvious lines.
|
||||||
*/
|
*/
|
||||||
export declare function createContentHelpers({ baseUrl, config, content, i18n, pagesSlug, robots: robotsOptions, settingsSlug, }: CreateContentHelpersArgs): {
|
export declare function createContentHelpers({ baseUrl, config, content, i18n, pagesSlug, robots: robotsOptions, settingsSlug, sitemapStyle, siteNameField, }: CreateContentHelpersArgs): {
|
||||||
generatePageMetadata: (locale: string, segments: string[] | undefined, page?: number) => Promise<PageMetadata>;
|
generatePageMetadata: (locale: string, segments: string[] | undefined, page?: number) => Promise<PageMetadata>;
|
||||||
generateStaticParams: () => Promise<Array<{
|
generateStaticParams: () => Promise<Array<{
|
||||||
locale: string;
|
locale: string;
|
||||||
@@ -74,5 +84,6 @@ export declare function createContentHelpers({ baseUrl, config, content, i18n, p
|
|||||||
resolveRoute: (locale: string, segments: string[] | undefined, page: number) => Promise<null | ResolvedRoute>;
|
resolveRoute: (locale: string, segments: string[] | undefined, page: number) => Promise<null | ResolvedRoute>;
|
||||||
robots: () => RobotsRules;
|
robots: () => RobotsRules;
|
||||||
sitemap: () => Promise<SitemapEntry[]>;
|
sitemap: () => Promise<SitemapEntry[]>;
|
||||||
|
sitemapRoute: (req?: Request) => Promise<Response>;
|
||||||
};
|
};
|
||||||
export {};
|
export {};
|
||||||
|
|||||||
+24
-3
@@ -1,7 +1,7 @@
|
|||||||
import { getPayload } from 'payload';
|
import { getPayload } from 'payload';
|
||||||
import { cache } from 'react';
|
import { cache } from 'react';
|
||||||
import { getArchiveEntries, resolveRoute as resolveRouteRaw } from '../content/index.js';
|
import { getArchiveEntries, resolveRoute as resolveRouteRaw } from '../content/index.js';
|
||||||
import { buildRobots, buildSitemapEntries, createPageMetadata } from '../seo/index.js';
|
import { buildRobots, buildSitemapEntries, createPageMetadata, createSitemapRouteHandler } from '../seo/index.js';
|
||||||
/**
|
/**
|
||||||
* Bundles the per-request data helpers a frontend needs — the same cached
|
* Bundles the per-request data helpers a frontend needs — the same cached
|
||||||
* wrappers every project was writing by hand (getPayload, settings, locale
|
* wrappers every project was writing by hand (getPayload, settings, locale
|
||||||
@@ -27,7 +27,7 @@ import { buildRobots, buildSitemapEntries, createPageMetadata } from '../seo/ind
|
|||||||
* `resolveRoute` and `getEntries` are separate on purpose: routing decides what
|
* `resolveRoute` and `getEntries` are separate on purpose: routing decides what
|
||||||
* a URL is, fetching gets the listing. Metadata generation needs the first and
|
* a URL is, fetching gets the listing. Metadata generation needs the first and
|
||||||
* not the second, and a page component composes them in two obvious lines.
|
* not the second, and a page component composes them in two obvious lines.
|
||||||
*/ export function createContentHelpers({ baseUrl, config, content, i18n, pagesSlug = 'pages', robots: robotsOptions, settingsSlug = 'site-settings' }) {
|
*/ export function createContentHelpers({ baseUrl, config, content, i18n, pagesSlug = 'pages', robots: robotsOptions, settingsSlug = 'site-settings', sitemapStyle, siteNameField = 'siteName' }) {
|
||||||
const origin = baseUrl ?? process.env.NEXT_PUBLIC_SERVER_URL ?? '';
|
const origin = baseUrl ?? process.env.NEXT_PUBLIC_SERVER_URL ?? '';
|
||||||
const getCachedPayload = cache(async ()=>getPayload({
|
const getCachedPayload = cache(async ()=>getPayload({
|
||||||
config: await config
|
config: await config
|
||||||
@@ -311,6 +311,26 @@ import { buildRobots, buildSitemapEntries, createPageMetadata } from '../seo/ind
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* Route handler for app/sitemap.xml/route.ts — XML for crawlers, styled for
|
||||||
|
* people (`?style` serves the CSS from the plugin; nothing in /public):
|
||||||
|
*
|
||||||
|
* export { sitemapRoute as GET } from '@/lib/content'
|
||||||
|
* export const dynamic = 'force-dynamic'
|
||||||
|
*/ const sitemapRoute = createSitemapRouteHandler(sitemap, {
|
||||||
|
style: sitemapStyle === false ? false : {
|
||||||
|
...sitemapStyle,
|
||||||
|
title: sitemapStyle?.title ?? (async ()=>{
|
||||||
|
const locale = i18n?.defaultLocale;
|
||||||
|
if (!locale) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
const s = await getSettings(locale);
|
||||||
|
const name = s?.[siteNameField];
|
||||||
|
return typeof name === 'string' ? name : undefined;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
return {
|
return {
|
||||||
generatePageMetadata,
|
generatePageMetadata,
|
||||||
generateStaticParams,
|
generateStaticParams,
|
||||||
@@ -321,7 +341,8 @@ import { buildRobots, buildSitemapEntries, createPageMetadata } from '../seo/ind
|
|||||||
getSettings,
|
getSettings,
|
||||||
resolveRoute,
|
resolveRoute,
|
||||||
robots,
|
robots,
|
||||||
sitemap
|
sitemap,
|
||||||
|
sitemapRoute
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+33
-30
@@ -1,38 +1,41 @@
|
|||||||
export { buildAutoFillMetaHook } from './autoFillMeta.js';
|
export type { SeoOption, SeoMeta } from './types.js';
|
||||||
export type { AutoFillMapping } from './autoFillMeta.js';
|
export { composeTitle } from './composeTitle.js';
|
||||||
export { buildArticleJsonLd } from './buildArticleJsonLd.js';
|
export type { TitleOrder } from './composeTitle.js';
|
||||||
export { buildBreadcrumbJsonLd } from './buildBreadcrumbJsonLd.js';
|
export { buildHreflangAlternates } from './hreflang.js';
|
||||||
export { buildFaqJsonLd } from './buildFaqJsonLd.js';
|
|
||||||
export { buildIconsMetadata } from './buildIconsMetadata.js';
|
|
||||||
export { buildLlmsTxt } from './buildLlmsTxt.js';
|
|
||||||
export { buildLocalBusinessJsonLd } from './buildLocalBusinessJsonLd.js';
|
|
||||||
export { createManifestHandler } from './buildManifest.js';
|
|
||||||
export { buildMetadata } from './buildMetadata.js';
|
export { buildMetadata } from './buildMetadata.js';
|
||||||
export type { PageMetadata } from './buildMetadata.js';
|
export type { PageMetadata } from './buildMetadata.js';
|
||||||
export { buildNoindexField } from './buildNoindexField.js';
|
export { buildSeoPlugin } from './seoPluginConfig.js';
|
||||||
export { buildOrganizationJsonLd } from './buildOrganizationJsonLd.js';
|
export { buildAutoFillMetaHook } from './autoFillMeta.js';
|
||||||
export { AI_ASSISTANT_BOTS, AI_TRAINING_BOTS, buildRobots } from './buildRobots.js';
|
export { injectAutoFillMeta } from './injectAutoFillMeta.js';
|
||||||
export type { RobotsOptions, RobotsRules } from './buildRobots.js';
|
export { injectSeoTabs } from './injectSeoTabs.js';
|
||||||
export { buildServiceJsonLd } from './buildServiceJsonLd.js';
|
export type { AutoFillMapping } from './autoFillMeta.js';
|
||||||
|
export { createMetadataGenerator } from './createMetadataGenerator.js';
|
||||||
|
export { createPageMetadata } from './createPageMetadata.js';
|
||||||
|
export { readSiteMetaConfig } from './readSiteMetaConfig.js';
|
||||||
|
export type { SiteMetaConfig } from './readSiteMetaConfig.js';
|
||||||
|
export { slugsAcrossLocales } from './slugsAcrossLocales.js';
|
||||||
export { buildSitemapEntries } from './buildSitemapEntries.js';
|
export { buildSitemapEntries } from './buildSitemapEntries.js';
|
||||||
export type { SitemapEntry } from './buildSitemapEntries.js';
|
|
||||||
export { buildSitemapXml } from './buildSitemapXml.js';
|
export { buildSitemapXml } from './buildSitemapXml.js';
|
||||||
export { buildSiteNavigationJsonLd } from './buildSiteNavigationJsonLd.js';
|
export type { SitemapEntry } from './buildSitemapEntries.js';
|
||||||
|
export { buildRobots, AI_ASSISTANT_BOTS, AI_TRAINING_BOTS } from './buildRobots.js';
|
||||||
|
export type { RobotsRules, RobotsOptions } from './buildRobots.js';
|
||||||
|
export { buildIconsMetadata } from './buildIconsMetadata.js';
|
||||||
|
export { buildOrganizationJsonLd } from './buildOrganizationJsonLd.js';
|
||||||
|
export { validateFaviconField } from './validateFavicon.js';
|
||||||
|
export { buildNoindexField } from './buildNoindexField.js';
|
||||||
export { buildSpeakableJsonLd } from './buildSpeakableJsonLd.js';
|
export { buildSpeakableJsonLd } from './buildSpeakableJsonLd.js';
|
||||||
export { buildSummaryField } from './buildSummaryField.js';
|
export { buildSummaryField } from './buildSummaryField.js';
|
||||||
export { buildWebSiteJsonLd } from './buildWebSiteJsonLd.js';
|
export { buildWebSiteJsonLd } from './buildWebSiteJsonLd.js';
|
||||||
export { composeTitle } from './composeTitle.js';
|
export { buildBreadcrumbJsonLd } from './buildBreadcrumbJsonLd.js';
|
||||||
export type { TitleOrder } from './composeTitle.js';
|
export { buildSiteNavigationJsonLd } from './buildSiteNavigationJsonLd.js';
|
||||||
export { createMetadataGenerator } from './createMetadataGenerator.js';
|
export { buildLocalBusinessJsonLd } from './buildLocalBusinessJsonLd.js';
|
||||||
export { createPageMetadata } from './createPageMetadata.js';
|
export { buildFaqJsonLd } from './buildFaqJsonLd.js';
|
||||||
export { buildHreflangAlternates } from './hreflang.js';
|
export { buildServiceJsonLd } from './buildServiceJsonLd.js';
|
||||||
export { injectAutoFillMeta } from './injectAutoFillMeta.js';
|
export { buildArticleJsonLd } from './buildArticleJsonLd.js';
|
||||||
export { injectSeoTabs } from './injectSeoTabs.js';
|
export { buildLlmsTxt } from './buildLlmsTxt.js';
|
||||||
export { JsonLdGraph } from './JsonLdGraph.js';
|
|
||||||
export { readSiteMetaConfig } from './readSiteMetaConfig.js';
|
|
||||||
export type { SiteMetaConfig } from './readSiteMetaConfig.js';
|
|
||||||
export { createLlmsTxtRoute, createSitemapRouteHandler } from './routeHandlers.js';
|
export { createLlmsTxtRoute, createSitemapRouteHandler } from './routeHandlers.js';
|
||||||
export { buildSeoPlugin } from './seoPluginConfig.js';
|
export type { SitemapRouteOptions } from './routeHandlers.js';
|
||||||
export { slugsAcrossLocales } from './slugsAcrossLocales.js';
|
export { buildSitemapCss, SITEMAP_STYLE_PARAM, DEFAULT_SITEMAP_CREDIT } from './sitemapStyle.js';
|
||||||
export type { SeoMeta, SeoOption } from './types.js';
|
export type { SitemapStyleOptions } from './sitemapStyle.js';
|
||||||
export { validateFaviconField } from './validateFavicon.js';
|
export { createManifestHandler } from './buildManifest.js';
|
||||||
|
export { JsonLdGraph } from './JsonLdGraph.js';
|
||||||
|
|||||||
Vendored
+25
-24
@@ -1,33 +1,34 @@
|
|||||||
export { buildAutoFillMetaHook } from './autoFillMeta.js';
|
export { composeTitle } from './composeTitle.js';
|
||||||
export { buildArticleJsonLd } from './buildArticleJsonLd.js';
|
export { buildHreflangAlternates } from './hreflang.js';
|
||||||
export { buildBreadcrumbJsonLd } from './buildBreadcrumbJsonLd.js';
|
|
||||||
export { buildFaqJsonLd } from './buildFaqJsonLd.js';
|
|
||||||
export { buildIconsMetadata } from './buildIconsMetadata.js';
|
|
||||||
export { buildLlmsTxt } from './buildLlmsTxt.js';
|
|
||||||
export { buildLocalBusinessJsonLd } from './buildLocalBusinessJsonLd.js';
|
|
||||||
export { createManifestHandler } from './buildManifest.js';
|
|
||||||
export { buildMetadata } from './buildMetadata.js';
|
export { buildMetadata } from './buildMetadata.js';
|
||||||
export { buildNoindexField } from './buildNoindexField.js';
|
export { buildSeoPlugin } from './seoPluginConfig.js';
|
||||||
export { buildOrganizationJsonLd } from './buildOrganizationJsonLd.js';
|
export { buildAutoFillMetaHook } from './autoFillMeta.js';
|
||||||
export { AI_ASSISTANT_BOTS, AI_TRAINING_BOTS, buildRobots } from './buildRobots.js';
|
export { injectAutoFillMeta } from './injectAutoFillMeta.js';
|
||||||
export { buildServiceJsonLd } from './buildServiceJsonLd.js';
|
export { injectSeoTabs } from './injectSeoTabs.js';
|
||||||
|
export { createMetadataGenerator } from './createMetadataGenerator.js';
|
||||||
|
export { createPageMetadata } from './createPageMetadata.js';
|
||||||
|
export { readSiteMetaConfig } from './readSiteMetaConfig.js';
|
||||||
|
export { slugsAcrossLocales } from './slugsAcrossLocales.js';
|
||||||
export { buildSitemapEntries } from './buildSitemapEntries.js';
|
export { buildSitemapEntries } from './buildSitemapEntries.js';
|
||||||
export { buildSitemapXml } from './buildSitemapXml.js';
|
export { buildSitemapXml } from './buildSitemapXml.js';
|
||||||
export { buildSiteNavigationJsonLd } from './buildSiteNavigationJsonLd.js';
|
export { buildRobots, AI_ASSISTANT_BOTS, AI_TRAINING_BOTS } from './buildRobots.js';
|
||||||
|
export { buildIconsMetadata } from './buildIconsMetadata.js';
|
||||||
|
export { buildOrganizationJsonLd } from './buildOrganizationJsonLd.js';
|
||||||
|
export { validateFaviconField } from './validateFavicon.js';
|
||||||
|
export { buildNoindexField } from './buildNoindexField.js';
|
||||||
export { buildSpeakableJsonLd } from './buildSpeakableJsonLd.js';
|
export { buildSpeakableJsonLd } from './buildSpeakableJsonLd.js';
|
||||||
export { buildSummaryField } from './buildSummaryField.js';
|
export { buildSummaryField } from './buildSummaryField.js';
|
||||||
export { buildWebSiteJsonLd } from './buildWebSiteJsonLd.js';
|
export { buildWebSiteJsonLd } from './buildWebSiteJsonLd.js';
|
||||||
export { composeTitle } from './composeTitle.js';
|
export { buildBreadcrumbJsonLd } from './buildBreadcrumbJsonLd.js';
|
||||||
export { createMetadataGenerator } from './createMetadataGenerator.js';
|
export { buildSiteNavigationJsonLd } from './buildSiteNavigationJsonLd.js';
|
||||||
export { createPageMetadata } from './createPageMetadata.js';
|
export { buildLocalBusinessJsonLd } from './buildLocalBusinessJsonLd.js';
|
||||||
export { buildHreflangAlternates } from './hreflang.js';
|
export { buildFaqJsonLd } from './buildFaqJsonLd.js';
|
||||||
export { injectAutoFillMeta } from './injectAutoFillMeta.js';
|
export { buildServiceJsonLd } from './buildServiceJsonLd.js';
|
||||||
export { injectSeoTabs } from './injectSeoTabs.js';
|
export { buildArticleJsonLd } from './buildArticleJsonLd.js';
|
||||||
export { JsonLdGraph } from './JsonLdGraph.js';
|
export { buildLlmsTxt } from './buildLlmsTxt.js';
|
||||||
export { readSiteMetaConfig } from './readSiteMetaConfig.js';
|
|
||||||
export { createLlmsTxtRoute, createSitemapRouteHandler } from './routeHandlers.js';
|
export { createLlmsTxtRoute, createSitemapRouteHandler } from './routeHandlers.js';
|
||||||
export { buildSeoPlugin } from './seoPluginConfig.js';
|
export { buildSitemapCss, SITEMAP_STYLE_PARAM, DEFAULT_SITEMAP_CREDIT } from './sitemapStyle.js';
|
||||||
export { slugsAcrossLocales } from './slugsAcrossLocales.js';
|
export { createManifestHandler } from './buildManifest.js';
|
||||||
export { validateFaviconField } from './validateFavicon.js';
|
export { JsonLdGraph } from './JsonLdGraph.js';
|
||||||
|
|
||||||
//# sourceMappingURL=index.js.map
|
//# sourceMappingURL=index.js.map
|
||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../src/modules/seo/index.ts"],"sourcesContent":["export { buildAutoFillMetaHook } from './autoFillMeta.js'\nexport type { AutoFillMapping } from './autoFillMeta.js'\nexport { buildArticleJsonLd } from './buildArticleJsonLd.js'\nexport { buildBreadcrumbJsonLd } from './buildBreadcrumbJsonLd.js'\nexport { buildFaqJsonLd } from './buildFaqJsonLd.js'\nexport { buildIconsMetadata } from './buildIconsMetadata.js'\nexport { buildLlmsTxt } from './buildLlmsTxt.js'\nexport { buildLocalBusinessJsonLd } from './buildLocalBusinessJsonLd.js'\nexport { createManifestHandler } from './buildManifest.js'\nexport { buildMetadata } from './buildMetadata.js'\nexport type { PageMetadata } from './buildMetadata.js'\nexport { buildNoindexField } from './buildNoindexField.js'\nexport { buildOrganizationJsonLd } from './buildOrganizationJsonLd.js'\nexport { AI_ASSISTANT_BOTS, AI_TRAINING_BOTS, buildRobots } from './buildRobots.js'\nexport type { RobotsOptions, RobotsRules } from './buildRobots.js'\nexport { buildServiceJsonLd } from './buildServiceJsonLd.js'\nexport { buildSitemapEntries } from './buildSitemapEntries.js'\nexport type { SitemapEntry } from './buildSitemapEntries.js'\nexport { buildSitemapXml } from './buildSitemapXml.js'\nexport { buildSiteNavigationJsonLd } from './buildSiteNavigationJsonLd.js'\nexport { buildSpeakableJsonLd } from './buildSpeakableJsonLd.js'\nexport { buildSummaryField } from './buildSummaryField.js'\nexport { buildWebSiteJsonLd } from './buildWebSiteJsonLd.js'\nexport { composeTitle } from './composeTitle.js'\nexport type { TitleOrder } from './composeTitle.js'\nexport { createMetadataGenerator } from './createMetadataGenerator.js'\nexport { createPageMetadata } from './createPageMetadata.js'\nexport { buildHreflangAlternates } from './hreflang.js'\nexport { injectAutoFillMeta } from './injectAutoFillMeta.js'\nexport { injectSeoTabs } from './injectSeoTabs.js'\nexport { JsonLdGraph } from './JsonLdGraph.js'\nexport { readSiteMetaConfig } from './readSiteMetaConfig.js'\nexport type { SiteMetaConfig } from './readSiteMetaConfig.js'\nexport { createLlmsTxtRoute, createSitemapRouteHandler } from './routeHandlers.js'\nexport { buildSeoPlugin } from './seoPluginConfig.js'\nexport { slugsAcrossLocales } from './slugsAcrossLocales.js'\nexport type { SeoMeta, SeoOption } from './types.js'\nexport { validateFaviconField } from './validateFavicon.js'\n"],"names":["buildAutoFillMetaHook","buildArticleJsonLd","buildBreadcrumbJsonLd","buildFaqJsonLd","buildIconsMetadata","buildLlmsTxt","buildLocalBusinessJsonLd","createManifestHandler","buildMetadata","buildNoindexField","buildOrganizationJsonLd","AI_ASSISTANT_BOTS","AI_TRAINING_BOTS","buildRobots","buildServiceJsonLd","buildSitemapEntries","buildSitemapXml","buildSiteNavigationJsonLd","buildSpeakableJsonLd","buildSummaryField","buildWebSiteJsonLd","composeTitle","createMetadataGenerator","createPageMetadata","buildHreflangAlternates","injectAutoFillMeta","injectSeoTabs","JsonLdGraph","readSiteMetaConfig","createLlmsTxtRoute","createSitemapRouteHandler","buildSeoPlugin","slugsAcrossLocales","validateFaviconField"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,oBAAmB;AAEzD,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,qBAAqB,QAAQ,6BAA4B;AAClE,SAASC,cAAc,QAAQ,sBAAqB;AACpD,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,YAAY,QAAQ,oBAAmB;AAChD,SAASC,wBAAwB,QAAQ,gCAA+B;AACxE,SAASC,qBAAqB,QAAQ,qBAAoB;AAC1D,SAASC,aAAa,QAAQ,qBAAoB;AAElD,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,uBAAuB,QAAQ,+BAA8B;AACtE,SAASC,iBAAiB,EAAEC,gBAAgB,EAAEC,WAAW,QAAQ,mBAAkB;AAEnF,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,mBAAmB,QAAQ,2BAA0B;AAE9D,SAASC,eAAe,QAAQ,uBAAsB;AACtD,SAASC,yBAAyB,QAAQ,iCAAgC;AAC1E,SAASC,oBAAoB,QAAQ,4BAA2B;AAChE,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,YAAY,QAAQ,oBAAmB;AAEhD,SAASC,uBAAuB,QAAQ,+BAA8B;AACtE,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,uBAAuB,QAAQ,gBAAe;AACvD,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,aAAa,QAAQ,qBAAoB;AAClD,SAASC,WAAW,QAAQ,mBAAkB;AAC9C,SAASC,kBAAkB,QAAQ,0BAAyB;AAE5D,SAASC,kBAAkB,EAAEC,yBAAyB,QAAQ,qBAAoB;AAClF,SAASC,cAAc,QAAQ,uBAAsB;AACrD,SAASC,kBAAkB,QAAQ,0BAAyB;AAE5D,SAASC,oBAAoB,QAAQ,uBAAsB"}
|
{"version":3,"sources":["../../../src/modules/seo/index.ts"],"sourcesContent":["export type { SeoOption, SeoMeta } from './types.js'\nexport { composeTitle } from './composeTitle.js'\nexport type { TitleOrder } from './composeTitle.js'\nexport { buildHreflangAlternates } from './hreflang.js'\nexport { buildMetadata } from './buildMetadata.js'\nexport type { PageMetadata } from './buildMetadata.js'\nexport { buildSeoPlugin } from './seoPluginConfig.js'\nexport { buildAutoFillMetaHook } from './autoFillMeta.js'\nexport { injectAutoFillMeta } from './injectAutoFillMeta.js'\nexport { injectSeoTabs } from './injectSeoTabs.js'\nexport type { AutoFillMapping } from './autoFillMeta.js'\nexport { createMetadataGenerator } from './createMetadataGenerator.js'\nexport { createPageMetadata } from './createPageMetadata.js'\nexport { readSiteMetaConfig } from './readSiteMetaConfig.js'\nexport type { SiteMetaConfig } from './readSiteMetaConfig.js'\nexport { slugsAcrossLocales } from './slugsAcrossLocales.js'\nexport { buildSitemapEntries } from './buildSitemapEntries.js'\nexport { buildSitemapXml } from './buildSitemapXml.js'\nexport type { SitemapEntry } from './buildSitemapEntries.js'\nexport { buildRobots, AI_ASSISTANT_BOTS, AI_TRAINING_BOTS } from './buildRobots.js'\nexport type { RobotsRules, RobotsOptions } from './buildRobots.js'\nexport { buildIconsMetadata } from './buildIconsMetadata.js'\nexport { buildOrganizationJsonLd } from './buildOrganizationJsonLd.js'\nexport { validateFaviconField } from './validateFavicon.js'\nexport { buildNoindexField } from './buildNoindexField.js'\nexport { buildSpeakableJsonLd } from './buildSpeakableJsonLd.js'\nexport { buildSummaryField } from './buildSummaryField.js'\nexport { buildWebSiteJsonLd } from './buildWebSiteJsonLd.js'\nexport { buildBreadcrumbJsonLd } from './buildBreadcrumbJsonLd.js'\nexport { buildSiteNavigationJsonLd } from './buildSiteNavigationJsonLd.js'\nexport { buildLocalBusinessJsonLd } from './buildLocalBusinessJsonLd.js'\nexport { buildFaqJsonLd } from './buildFaqJsonLd.js'\nexport { buildServiceJsonLd } from './buildServiceJsonLd.js'\nexport { buildArticleJsonLd } from './buildArticleJsonLd.js'\nexport { buildLlmsTxt } from './buildLlmsTxt.js'\nexport { createLlmsTxtRoute, createSitemapRouteHandler } from './routeHandlers.js'\nexport type { SitemapRouteOptions } from './routeHandlers.js'\nexport { buildSitemapCss, SITEMAP_STYLE_PARAM, DEFAULT_SITEMAP_CREDIT } from './sitemapStyle.js'\nexport type { SitemapStyleOptions } from './sitemapStyle.js'\nexport { createManifestHandler } from './buildManifest.js'\nexport { JsonLdGraph } from './JsonLdGraph.js'\n"],"names":["composeTitle","buildHreflangAlternates","buildMetadata","buildSeoPlugin","buildAutoFillMetaHook","injectAutoFillMeta","injectSeoTabs","createMetadataGenerator","createPageMetadata","readSiteMetaConfig","slugsAcrossLocales","buildSitemapEntries","buildSitemapXml","buildRobots","AI_ASSISTANT_BOTS","AI_TRAINING_BOTS","buildIconsMetadata","buildOrganizationJsonLd","validateFaviconField","buildNoindexField","buildSpeakableJsonLd","buildSummaryField","buildWebSiteJsonLd","buildBreadcrumbJsonLd","buildSiteNavigationJsonLd","buildLocalBusinessJsonLd","buildFaqJsonLd","buildServiceJsonLd","buildArticleJsonLd","buildLlmsTxt","createLlmsTxtRoute","createSitemapRouteHandler","buildSitemapCss","SITEMAP_STYLE_PARAM","DEFAULT_SITEMAP_CREDIT","createManifestHandler","JsonLdGraph"],"mappings":"AACA,SAASA,YAAY,QAAQ,oBAAmB;AAEhD,SAASC,uBAAuB,QAAQ,gBAAe;AACvD,SAASC,aAAa,QAAQ,qBAAoB;AAElD,SAASC,cAAc,QAAQ,uBAAsB;AACrD,SAASC,qBAAqB,QAAQ,oBAAmB;AACzD,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,aAAa,QAAQ,qBAAoB;AAElD,SAASC,uBAAuB,QAAQ,+BAA8B;AACtE,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,kBAAkB,QAAQ,0BAAyB;AAE5D,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,mBAAmB,QAAQ,2BAA0B;AAC9D,SAASC,eAAe,QAAQ,uBAAsB;AAEtD,SAASC,WAAW,EAAEC,iBAAiB,EAAEC,gBAAgB,QAAQ,mBAAkB;AAEnF,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,uBAAuB,QAAQ,+BAA8B;AACtE,SAASC,oBAAoB,QAAQ,uBAAsB;AAC3D,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,oBAAoB,QAAQ,4BAA2B;AAChE,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,qBAAqB,QAAQ,6BAA4B;AAClE,SAASC,yBAAyB,QAAQ,iCAAgC;AAC1E,SAASC,wBAAwB,QAAQ,gCAA+B;AACxE,SAASC,cAAc,QAAQ,sBAAqB;AACpD,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,YAAY,QAAQ,oBAAmB;AAChD,SAASC,kBAAkB,EAAEC,yBAAyB,QAAQ,qBAAoB;AAElF,SAASC,eAAe,EAAEC,mBAAmB,EAAEC,sBAAsB,QAAQ,oBAAmB;AAEhG,SAASC,qBAAqB,QAAQ,qBAAoB;AAC1D,SAASC,WAAW,QAAQ,mBAAkB"}
|
||||||
Vendored
+29
-20
@@ -1,6 +1,7 @@
|
|||||||
import type { BasePayload } from 'payload';
|
import type { BasePayload } from 'payload';
|
||||||
import type { I18nConfig } from '../i18n/index.js';
|
import type { I18nConfig } from '../i18n/index.js';
|
||||||
import type { SitemapEntry } from './buildSitemapEntries.js';
|
import type { SitemapEntry } from './buildSitemapEntries.js';
|
||||||
|
import { type SitemapStyleOptions } from './sitemapStyle.js';
|
||||||
/**
|
/**
|
||||||
* Ready-made Next route handler for /llms.txt. Replaces the ~60-line try/catch
|
* Ready-made Next route handler for /llms.txt. Replaces the ~60-line try/catch
|
||||||
* every project was copying. buildLlmsTxt already handles collections without
|
* every project was copying. buildLlmsTxt already handles collections without
|
||||||
@@ -21,30 +22,38 @@ import type { SitemapEntry } from './buildSitemapEntries.js';
|
|||||||
* baseUrl: process.env.NEXT_PUBLIC_SERVER_URL!, full: true })
|
* baseUrl: process.env.NEXT_PUBLIC_SERVER_URL!, full: true })
|
||||||
*/
|
*/
|
||||||
export declare function createLlmsTxtRoute(opts: {
|
export declare function createLlmsTxtRoute(opts: {
|
||||||
baseUrl: string;
|
|
||||||
config: I18nConfig;
|
|
||||||
/** Inline every page's full Markdown (llms-full.txt). Default false. */
|
|
||||||
full?: boolean;
|
|
||||||
getCachedPayload: () => Promise<BasePayload>;
|
getCachedPayload: () => Promise<BasePayload>;
|
||||||
|
config: I18nConfig;
|
||||||
|
baseUrl: string;
|
||||||
pagesSlug?: string;
|
pagesSlug?: string;
|
||||||
settingsSlug?: string;
|
settingsSlug?: string;
|
||||||
|
/** Inline every page's full Markdown (llms-full.txt). Default false. */
|
||||||
|
full?: boolean;
|
||||||
/** Field holding a richer AI summary (buildSummaryField) to prefer as description. */
|
/** Field holding a richer AI summary (buildSummaryField) to prefer as description. */
|
||||||
summaryField?: string;
|
summaryField?: string;
|
||||||
}): () => Promise<Response>;
|
}): () => Promise<Response>;
|
||||||
/**
|
export type SitemapRouteOptions = {
|
||||||
* Ready-made Next route handler for /sitemap.xml with the CSS stylesheet.
|
/**
|
||||||
* Replaces the hand-written route in every project. Pass the project's `sitemap`
|
* Built-in browser look (default ON): the XML points at `<this route>?style`
|
||||||
* helper (from createContentHelpers) and optionally a cssUrl.
|
* and the same handler serves the CSS — nothing to copy into /public.
|
||||||
*
|
* `false` = raw XML. Object = header/credit/accent (SitemapStyleOptions);
|
||||||
* // app/sitemap.xml/route.ts
|
* `title` may be async (sitemapRoute passes the Site Settings name).
|
||||||
* import { createSitemapRouteHandler } from '@intecion/ipal-kit'
|
*/
|
||||||
* import { sitemap } from '@/lib/content'
|
style?: false | (Omit<SitemapStyleOptions, 'title'> & {
|
||||||
* export const dynamic = 'force-dynamic'
|
title?: string | (() => Promise<string | undefined>);
|
||||||
* export const GET = createSitemapRouteHandler(sitemap, { cssUrl: '/sitemap.css' })
|
});
|
||||||
*
|
/** Legacy: your own stylesheet URL (e.g. '/sitemap.css'). Overrides `style`. */
|
||||||
* Remember: if you use this, DON'T also keep app/sitemap.ts (two sitemaps
|
|
||||||
* confuse crawlers).
|
|
||||||
*/
|
|
||||||
export declare function createSitemapRouteHandler(sitemap: () => Promise<SitemapEntry[]>, opts?: {
|
|
||||||
cssUrl?: string;
|
cssUrl?: string;
|
||||||
}): () => Promise<Response>;
|
};
|
||||||
|
/**
|
||||||
|
* Ready-made Next route handler for /sitemap.xml, styled for humans out of the box.
|
||||||
|
* Usually you don't call this — `createContentHelpers` returns `sitemapRoute`:
|
||||||
|
*
|
||||||
|
* // app/sitemap.xml/route.ts — the whole file
|
||||||
|
* export { sitemapRoute as GET } from '@/lib/content'
|
||||||
|
* export const dynamic = 'force-dynamic'
|
||||||
|
*
|
||||||
|
* `GET /sitemap.xml` → XML (crawlers), `GET /sitemap.xml?style` → its CSS.
|
||||||
|
* Don't keep app/sitemap.ts next to it — two sitemaps confuse crawlers.
|
||||||
|
*/
|
||||||
|
export declare function createSitemapRouteHandler(sitemap: () => Promise<SitemapEntry[]>, opts?: SitemapRouteOptions): (req?: Request) => Promise<Response>;
|
||||||
|
|||||||
Vendored
+34
-15
@@ -1,5 +1,6 @@
|
|||||||
import { buildLlmsTxt } from './buildLlmsTxt.js';
|
import { buildLlmsTxt } from './buildLlmsTxt.js';
|
||||||
import { buildSitemapXml } from './buildSitemapXml.js';
|
import { buildSitemapXml } from './buildSitemapXml.js';
|
||||||
|
import { buildSitemapCss, SITEMAP_STYLE_PARAM } from './sitemapStyle.js';
|
||||||
/**
|
/**
|
||||||
* Ready-made Next route handler for /llms.txt. Replaces the ~60-line try/catch
|
* Ready-made Next route handler for /llms.txt. Replaces the ~60-line try/catch
|
||||||
* every project was copying. buildLlmsTxt already handles collections without
|
* every project was copying. buildLlmsTxt already handles collections without
|
||||||
@@ -23,12 +24,12 @@ import { buildSitemapXml } from './buildSitemapXml.js';
|
|||||||
try {
|
try {
|
||||||
const payload = await opts.getCachedPayload();
|
const payload = await opts.getCachedPayload();
|
||||||
const body = await buildLlmsTxt({
|
const body = await buildLlmsTxt({
|
||||||
baseUrl: opts.baseUrl,
|
|
||||||
config: opts.config,
|
|
||||||
full: opts.full,
|
|
||||||
pagesSlug: opts.pagesSlug,
|
|
||||||
payload,
|
payload,
|
||||||
|
config: opts.config,
|
||||||
|
baseUrl: opts.baseUrl,
|
||||||
|
pagesSlug: opts.pagesSlug,
|
||||||
settingsSlug: opts.settingsSlug,
|
settingsSlug: opts.settingsSlug,
|
||||||
|
full: opts.full,
|
||||||
summaryField: opts.summaryField
|
summaryField: opts.summaryField
|
||||||
});
|
});
|
||||||
return new Response(body, {
|
return new Response(body, {
|
||||||
@@ -49,24 +50,42 @@ import { buildSitemapXml } from './buildSitemapXml.js';
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Ready-made Next route handler for /sitemap.xml with the CSS stylesheet.
|
* Ready-made Next route handler for /sitemap.xml, styled for humans out of the box.
|
||||||
* Replaces the hand-written route in every project. Pass the project's `sitemap`
|
* Usually you don't call this — `createContentHelpers` returns `sitemapRoute`:
|
||||||
* helper (from createContentHelpers) and optionally a cssUrl.
|
|
||||||
*
|
*
|
||||||
* // app/sitemap.xml/route.ts
|
* // app/sitemap.xml/route.ts — the whole file
|
||||||
* import { createSitemapRouteHandler } from '@intecion/ipal-kit'
|
* export { sitemapRoute as GET } from '@/lib/content'
|
||||||
* import { sitemap } from '@/lib/content'
|
|
||||||
* export const dynamic = 'force-dynamic'
|
* export const dynamic = 'force-dynamic'
|
||||||
* export const GET = createSitemapRouteHandler(sitemap, { cssUrl: '/sitemap.css' })
|
|
||||||
*
|
*
|
||||||
* Remember: if you use this, DON'T also keep app/sitemap.ts (two sitemaps
|
* `GET /sitemap.xml` → XML (crawlers), `GET /sitemap.xml?style` → its CSS.
|
||||||
* confuse crawlers).
|
* Don't keep app/sitemap.ts next to it — two sitemaps confuse crawlers.
|
||||||
*/ export function createSitemapRouteHandler(sitemap, opts = {}) {
|
*/ export function createSitemapRouteHandler(sitemap, opts = {}) {
|
||||||
return async ()=>{
|
const style = opts.cssUrl ? false : opts.style === false ? false : opts.style ?? {};
|
||||||
|
return async (req)=>{
|
||||||
|
const url = req ? new URL(req.url) : null;
|
||||||
|
if (style && url?.searchParams.has(SITEMAP_STYLE_PARAM)) {
|
||||||
|
let title;
|
||||||
|
try {
|
||||||
|
title = typeof style.title === 'function' ? await style.title() : style.title;
|
||||||
|
} catch {
|
||||||
|
title = undefined; // DB down → generic heading, never a broken stylesheet
|
||||||
|
}
|
||||||
|
return new Response(buildSitemapCss({
|
||||||
|
...style,
|
||||||
|
title
|
||||||
|
}), {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'text/css; charset=utf-8',
|
||||||
|
'Cache-Control': 'public, max-age=3600',
|
||||||
|
'X-Robots-Tag': 'noindex'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const cssUrl = opts.cssUrl ?? (style ? `${url?.pathname ?? '/sitemap.xml'}?${SITEMAP_STYLE_PARAM}` : undefined);
|
||||||
try {
|
try {
|
||||||
const entries = await sitemap();
|
const entries = await sitemap();
|
||||||
const xml = buildSitemapXml(entries, {
|
const xml = buildSitemapXml(entries, {
|
||||||
cssUrl: opts.cssUrl
|
cssUrl
|
||||||
});
|
});
|
||||||
return new Response(xml, {
|
return new Response(xml, {
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+21
@@ -0,0 +1,21 @@
|
|||||||
|
/**
|
||||||
|
* Built-in look of /sitemap.xml in a browser — served by the sitemap route itself
|
||||||
|
* (`/sitemap.xml?style`), so projects ship NO sitemap.css and copy nothing.
|
||||||
|
* Plain CSS on XML (W3C "Associating Style Sheets with XML", type="text/css") —
|
||||||
|
* not XSLT, which browsers are removing. Crawlers ignore it.
|
||||||
|
*/
|
||||||
|
export type SitemapStyleOptions = {
|
||||||
|
/** Accent colour (card hover). Default '#027bd0'. Any plain CSS colour. */
|
||||||
|
accent?: string;
|
||||||
|
/**
|
||||||
|
* Line under the header — the technology provider. Default
|
||||||
|
* "Technology by Intecion.com". `false` hides it.
|
||||||
|
*/
|
||||||
|
credit?: false | string;
|
||||||
|
/** Header line. Default: the site name from Site Settings (sitemapRoute), else "XML Sitemap". */
|
||||||
|
title?: string;
|
||||||
|
};
|
||||||
|
/** Query parameter on the sitemap URL that returns the stylesheet instead of XML. */
|
||||||
|
export declare const SITEMAP_STYLE_PARAM = "style";
|
||||||
|
export declare const DEFAULT_SITEMAP_CREDIT = "Technology by Intecion.com";
|
||||||
|
export declare function buildSitemapCss({ accent, credit, title }?: SitemapStyleOptions): string;
|
||||||
Vendored
+70
@@ -0,0 +1,70 @@
|
|||||||
|
/**
|
||||||
|
* Built-in look of /sitemap.xml in a browser — served by the sitemap route itself
|
||||||
|
* (`/sitemap.xml?style`), so projects ship NO sitemap.css and copy nothing.
|
||||||
|
* Plain CSS on XML (W3C "Associating Style Sheets with XML", type="text/css") —
|
||||||
|
* not XSLT, which browsers are removing. Crawlers ignore it.
|
||||||
|
*/ /** Query parameter on the sitemap URL that returns the stylesheet instead of XML. */ export const SITEMAP_STYLE_PARAM = 'style';
|
||||||
|
export const DEFAULT_SITEMAP_CREDIT = 'Technology by Intecion.com';
|
||||||
|
/** CSS `content: "…"` value — escapes backslashes, quotes and newlines. */ const cssString = (s)=>`"${s.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/[\r\n]+/g, ' ')}"`;
|
||||||
|
/** Only plain colour values — the option ends up inside a stylesheet. */ const safeColor = (c, fallback)=>c && /^(#[0-9a-f]{3,8}|[a-z]+|(rgb|hsl|oklch)a?\([\d\s.,%/-]+\))$/i.test(c.trim()) ? c.trim() : fallback;
|
||||||
|
export function buildSitemapCss({ accent, credit, title } = {}) {
|
||||||
|
const heading = title?.trim() || 'XML Sitemap';
|
||||||
|
const note = credit === false ? '' : (credit ?? DEFAULT_SITEMAP_CREDIT).trim();
|
||||||
|
const acc = safeColor(accent, '#027bd0');
|
||||||
|
const divider = 'padding-bottom: 1.25rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border);';
|
||||||
|
return `:root {
|
||||||
|
--bg: #fafafa; --card: #ffffff; --border: #e5e7eb; --border-hover: #d1d5db;
|
||||||
|
--text-main: #111827; --text-secondary: #4b5563; --text-muted: #9ca3af; --url-color: #1e293b;
|
||||||
|
--badge-bg: #f3f4f6; --badge-border: #e5e7eb; --badge-text: #4b5563; --accent: ${acc};
|
||||||
|
}
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
:root {
|
||||||
|
--bg: #090a0f; --card: #12131a; --border: #1e202e; --border-hover: #2e3247;
|
||||||
|
--text-main: #f9fafb; --text-secondary: #9ca3af; --text-muted: #6b7280; --url-color: #f3f4f6;
|
||||||
|
--badge-bg: #1a1c26; --badge-border: #282b3d; --badge-text: #9ca3af;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
urlset {
|
||||||
|
display: flex; flex-direction: column; box-sizing: border-box; min-height: 100vh;
|
||||||
|
max-width: 1040px; margin: 0 auto; padding: 3rem 1.5rem; line-height: 1.5;
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
|
||||||
|
background-color: var(--bg); color: var(--text-main);
|
||||||
|
}
|
||||||
|
urlset::before {
|
||||||
|
content: ${cssString(heading)};
|
||||||
|
display: block; order: -2; font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em;
|
||||||
|
color: var(--text-main); ${note ? 'padding-bottom: 0.4rem;' : divider}
|
||||||
|
}
|
||||||
|
${note ? `urlset::after {
|
||||||
|
content: ${cssString(note)};
|
||||||
|
display: block; order: -1; font-size: 0.8rem; color: var(--text-muted); ${divider}
|
||||||
|
}
|
||||||
|
` : ''}url {
|
||||||
|
display: block; width: 100%; order: 0; box-sizing: border-box;
|
||||||
|
background-color: var(--card); border: 1px solid var(--border); border-radius: 8px;
|
||||||
|
padding: 1rem 1.25rem; margin-bottom: 0.65rem;
|
||||||
|
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
||||||
|
}
|
||||||
|
url:hover { border-color: var(--accent); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03); }
|
||||||
|
loc {
|
||||||
|
display: block; margin-bottom: 0.45rem; word-break: break-all; line-height: 1.45;
|
||||||
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
||||||
|
font-size: 0.875rem; font-weight: 500; color: var(--url-color);
|
||||||
|
}
|
||||||
|
lastmod, changefreq, priority {
|
||||||
|
display: inline-block; font-size: 0.775rem; color: var(--text-secondary);
|
||||||
|
margin-right: 1.25rem; margin-top: 0.15rem;
|
||||||
|
}
|
||||||
|
lastmod::before { content: "Updated: "; color: var(--text-muted); }
|
||||||
|
changefreq::before { content: "Frequency: "; color: var(--text-muted); }
|
||||||
|
priority::before { content: "Priority: "; color: var(--text-muted); }
|
||||||
|
link {
|
||||||
|
display: inline-block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
|
||||||
|
background-color: var(--badge-bg); border: 1px solid var(--badge-border); color: var(--badge-text);
|
||||||
|
padding: 0.1rem 0.45rem; border-radius: 4px; margin-right: 0.3rem; margin-top: 0.35rem;
|
||||||
|
}
|
||||||
|
link::before { content: attr(hreflang); }
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
//# sourceMappingURL=sitemapStyle.js.map
|
||||||
Vendored
+1
File diff suppressed because one or more lines are too long
+3
-2
@@ -165,7 +165,8 @@ src/
|
|||||||
[[...slug]]/page.tsx # PODWÓJNE nawiasy; RenderBlocks
|
[[...slug]]/page.tsx # PODWÓJNE nawiasy; RenderBlocks
|
||||||
(payload)/ # panel (generowany)
|
(payload)/ # panel (generowany)
|
||||||
manifest.ts # createManifestHandler + force-dynamic
|
manifest.ts # createManifestHandler + force-dynamic
|
||||||
sitemap.ts, robots.ts # z lib/content (+ force-dynamic na sitemap)
|
sitemap.xml/route.ts # sitemapRoute z lib/content + force-dynamic (wygląd z pluginu)
|
||||||
|
robots.ts # z lib/content
|
||||||
api/health/route.ts # createHealthRoute
|
api/health/route.ts # createHealthRoute
|
||||||
instrumentation.ts # assertEnv(ipalEnvRules({...}))
|
instrumentation.ts # assertEnv(ipalEnvRules({...}))
|
||||||
fields/ # sectionHeader.ts, sectionSettings.ts (linki: z pluginu)
|
fields/ # sectionHeader.ts, sectionSettings.ts (linki: z pluginu)
|
||||||
@@ -218,7 +219,7 @@ Bez skrótów (`HeroSection`, nie `HeroSec`). Nie twórz `lib/pages.ts`,
|
|||||||
Locale do bloków → `enhanceProps`; w `not-found.tsx` (brak `params`) →
|
Locale do bloków → `enhanceProps`; w `not-found.tsx` (brak `params`) →
|
||||||
wersja na każdy język + `<LocaleView>` (pages.md).
|
wersja na każdy język + `<LocaleView>` (pages.md).
|
||||||
7. **`export const dynamic = 'force-dynamic'`** na trasach czytających bazę:
|
7. **`export const dynamic = 'force-dynamic'`** na trasach czytających bazę:
|
||||||
`manifest.ts`, `sitemap.ts`/`sitemap.xml`, `llms.txt`, `api/health`. Handlery
|
`manifest.ts`, `sitemap.xml/route.ts`, `llms.txt`, `api/health`. Handlery
|
||||||
pluginu mają try/catch, ale `dynamic` musi być w pliku trasy.
|
pluginu mają try/catch, ale `dynamic` musi być w pliku trasy.
|
||||||
8. **`instrumentation.ts`** z `assertEnv(ipalEnvRules({...}))` (env.md).
|
8. **`instrumentation.ts`** z `assertEnv(ipalEnvRules({...}))` (env.md).
|
||||||
9. **RSC domyślnie.** `'use client'` tylko dla stanu/interakcji, w osobnym pliku;
|
9. **RSC domyślnie.** `'use client'` tylko dla stanu/interakcji, w osobnym pliku;
|
||||||
|
|||||||
@@ -55,6 +55,15 @@ if [ -d .agents ] && [ -f tsconfig.json ]; then
|
|||||||
"$(grep -qE '"exclude"[^]]*\.agents' tsconfig.json || echo tsconfig.json)"
|
"$(grep -qE '"exclude"[^]]*\.agents' tsconfig.json || echo tsconfig.json)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# --- Sitemap: one route, look from the plugin (seo.md) ---
|
||||||
|
SM_TS=$(ls src/app/sitemap.ts 2>/dev/null)
|
||||||
|
SM_ROUTE=$(ls src/app/sitemap.xml/route.ts 2>/dev/null)
|
||||||
|
if [ -n "$SM_TS" ] && [ -n "$SM_ROUTE" ]; then
|
||||||
|
report ERROR "two sitemaps" "seo.md — keep src/app/sitemap.xml/route.ts (sitemapRoute), delete src/app/sitemap.ts" "$(printf '%s\n%s' "$SM_TS" "$SM_ROUTE")"
|
||||||
|
fi
|
||||||
|
report WARNING "project copy of the sitemap stylesheet" "seo.md — sitemapRoute serves the look from the plugin; delete it (and cssUrl)" \
|
||||||
|
"$(ls public/sitemap.css 2>/dev/null)"
|
||||||
|
|
||||||
# --- Architecture (AGENT.md §4) ---
|
# --- Architecture (AGENT.md §4) ---
|
||||||
report ERROR "middleware.ts exists" "§4.1 Next 16 uses proxy.ts only" \
|
report ERROR "middleware.ts exists" "§4.1 Next 16 uses proxy.ts only" \
|
||||||
"$(ls src/middleware.ts middleware.ts 2>/dev/null)"
|
"$(ls src/middleware.ts middleware.ts 2>/dev/null)"
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ tylko, gdy użytkownik o to poprosi. Pełna budowa strony: skill **ipal-site**.
|
|||||||
6. **Routing** — `proxy.ts` (`createProxy`), `lib/content.ts`, layout bez
|
6. **Routing** — `proxy.ts` (`createProxy`), `lib/content.ts`, layout bez
|
||||||
`<head>`, catch-all z ISR + `generateStaticParams` + `resolveRedirect`,
|
`<head>`, catch-all z ISR + `generateStaticParams` + `resolveRedirect`,
|
||||||
`not-found.tsx` z `LocaleView` — bez `headers()`, wersja na każdy język (PROGRAMISTA §2.6–2.8, pages.md).
|
`not-found.tsx` z `LocaleView` — bez `headers()`, wersja na każdy język (PROGRAMISTA §2.6–2.8, pages.md).
|
||||||
7. **SEO i bezpieczeństwo** — sitemap, robots, manifest, llms.txt, health
|
7. **SEO i bezpieczeństwo** — sitemap (`sitemap.xml/route.ts` = `sitemapRoute`, bez CSS w `public/`), robots, manifest, llms.txt, health
|
||||||
(wszystkie z `force-dynamic`), `htmlLimitedBots`, `buildSecurityHeaders`,
|
(wszystkie z `force-dynamic`), `htmlLimitedBots`, `buildSecurityHeaders`,
|
||||||
`instrumentation.ts` z `assertEnv` (PROGRAMISTA §2.8–2.9).
|
`instrumentation.ts` z `assertEnv` (PROGRAMISTA §2.8–2.9).
|
||||||
8. **Nawigacja** — skill **ipal-nav**.
|
8. **Nawigacja** — skill **ipal-nav**.
|
||||||
|
|||||||
@@ -279,8 +279,8 @@ Archiwum z paginacją (`?page=`) — osobna trasa albo świadomie dynamiczna (pa
|
|||||||
(przykład w pages.md).
|
(przykład w pages.md).
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
// src/app/sitemap.ts
|
// src/app/sitemap.xml/route.ts — XML dla Google, wygląd dla ludzi z pluginu (nic w /public)
|
||||||
export { sitemap as default } from '@/lib/content'
|
export { sitemapRoute as GET } from '@/lib/content'
|
||||||
export const dynamic = 'force-dynamic'
|
export const dynamic = 'force-dynamic'
|
||||||
|
|
||||||
// src/app/robots.ts
|
// src/app/robots.ts
|
||||||
@@ -304,8 +304,9 @@ import { createHealthRoute } from '@intecion/ipal-kit'
|
|||||||
export const dynamic = 'force-dynamic'
|
export const dynamic = 'force-dynamic'
|
||||||
export const GET = createHealthRoute({ getCachedPayload })
|
export const GET = createHealthRoute({ getCachedPayload })
|
||||||
```
|
```
|
||||||
Albo `sitemap.ts`, albo `sitemap.xml/route.ts` (`createSitemapRouteHandler`) —
|
Jeden sitemap: `sitemap.xml/route.ts` **albo** `sitemap.ts` — nigdy oba. Nagłówek
|
||||||
nigdy oba.
|
sitemapy = `siteName` z Site Settings, pod nim „Technology by Intecion.com”; zmiana
|
||||||
|
przez `createContentHelpers({ sitemapStyle })` (seo.md).
|
||||||
|
|
||||||
### 2.9 next.config.ts i instrumentation.ts
|
### 2.9 next.config.ts i instrumentation.ts
|
||||||
```ts
|
```ts
|
||||||
@@ -470,6 +471,7 @@ Rób po jednej pozycji, buduj, sprawdzaj. Kolejność wg wagi:
|
|||||||
| 15c | `createPageMetadata(...)` w `page.tsx` | `generatePageMetadata(locale, slug)` z `lib/content` — wspólny cache z komponentem strony, mniej zapytań | seo.md |
|
| 15c | `createPageMetadata(...)` w `page.tsx` | `generatePageMetadata(locale, slug)` z `lib/content` — wspólny cache z komponentem strony, mniej zapytań | seo.md |
|
||||||
| 15d | brak limitów na za duże obrazy / wideo w Media | `buildOptimizeUploadHook()` + `buildOptimizeUploadField()`, migracja pola | storage.md |
|
| 15d | brak limitów na za duże obrazy / wideo w Media | `buildOptimizeUploadHook()` + `buildOptimizeUploadField()`, migracja pola | storage.md |
|
||||||
| 15e | tablice „Add Row”, wiersze „Item 01”, `cta1`/`cta2`, etykiety PL w panelu | `labels` + `rowLabel()` na tablicach, sloty → tablica (z migracją!), etykiety EN — AGENT.md §6.5a; po aktualizacji pluginu **`pnpm payload generate:importmap`** (buildLinksField używa `RowLabel`) | links.md |
|
| 15e | tablice „Add Row”, wiersze „Item 01”, `cta1`/`cta2`, etykiety PL w panelu | `labels` + `rowLabel()` na tablicach, sloty → tablica (z migracją!), etykiety EN — AGENT.md §6.5a; po aktualizacji pluginu **`pnpm payload generate:importmap`** (buildLinksField używa `RowLabel`) | links.md |
|
||||||
|
| 15f | `public/sitemap.css` + własna trasa / `app/sitemap.ts` | `app/sitemap.xml/route.ts`: `export { sitemapRoute as GET } from '@/lib/content'` + `force-dynamic`; usuń `public/sitemap.css` i `app/sitemap.ts` | seo.md |
|
||||||
| 16 | 404 na sztywno | rola 404 w System Pages + `getNotFoundPage` | pages.md |
|
| 16 | 404 na sztywno | rola 404 w System Pages + `getNotFoundPage` | pages.md |
|
||||||
| 16a | `privacyPolicy: { label: 'Polityka prywatności', … }` w layoucie | usuń cały parametr; tekst wpisz w Cookie Settings → Privacy link label | consent.md |
|
| 16a | `privacyPolicy: { label: 'Polityka prywatności', … }` w layoucie | usuń cały parametr; tekst wpisz w Cookie Settings → Privacy link label | consent.md |
|
||||||
| 17 | Opcjonalnie — AI/GEO | Markdown per strona, llms-full, boty AI w robots, MCP, wyszukiwarka, speakable, aiSummary | content.md, seo.md, mcp.md |
|
| 17 | Opcjonalnie — AI/GEO | Markdown per strona, llms-full, boty AI w robots, MCP, wyszukiwarka, speakable, aiSummary | content.md, seo.md, mcp.md |
|
||||||
|
|||||||
+1
-1
@@ -184,7 +184,7 @@ Sprawdź: `/` → `/<domyślny język>`; `pnpm build` pokazuje strony jako `●`
|
|||||||
|
|
||||||
```
|
```
|
||||||
Zrób wg PROGRAMISTA.md §2.8–2.9 i seo.md:
|
Zrób wg PROGRAMISTA.md §2.8–2.9 i seo.md:
|
||||||
- app/sitemap.ts, robots.ts, manifest.ts (createManifestHandler), llms.txt/route.ts,
|
- app/sitemap.xml/route.ts (sitemapRoute z lib/content), robots.ts, manifest.ts (createManifestHandler), llms.txt/route.ts,
|
||||||
api/health/route.ts — każda trasa czytająca bazę z export const dynamic = 'force-dynamic',
|
api/health/route.ts — każda trasa czytająca bazę z export const dynamic = 'force-dynamic',
|
||||||
- next.config.ts: htmlLimitedBots, buildSecurityHeaders,
|
- next.config.ts: htmlLimitedBots, buildSecurityHeaders,
|
||||||
- metadata strony przez generatePageMetadata z lib/content (wspólny cache), favicon przez buildIconsMetadata,
|
- metadata strony przez generatePageMetadata z lib/content (wspólny cache), favicon przez buildIconsMetadata,
|
||||||
|
|||||||
+25
-44
@@ -1066,65 +1066,46 @@ Listy botów: `AI_ASSISTANT_BOTS`, `AI_TRAINING_BOTS` (eksportowane; nadpisujesz
|
|||||||
przez `aiAssistantAgents` / `aiTrainingAgents`). `Next` akceptuje `rules` jako
|
przez `aiAssistantAgents` / `aiTrainingAgents`). `Next` akceptuje `rules` jako
|
||||||
tablicę — przy aktywnych botach AI zwracana jest tablica reguł.
|
tablicę — przy aktywnych botach AI zwracana jest tablica reguł.
|
||||||
|
|
||||||
## Sitemap czytelny w przeglądarce (czysty XML)
|
## Sitemap — czytelny w przeglądarce, zero plików w projekcie
|
||||||
|
|
||||||
Domyślny `/sitemap.xml` (Next MetadataRoute) działa dla Google, ale w przeglądarce
|
`createContentHelpers` zwraca `sitemapRoute`: XML dla crawlerów, a dla ludzi
|
||||||
bywa nieczytelny. Możesz serwować go jako **czysty, sformatowany XML** przez
|
gotowy wygląd (kafelki, pigułki hreflang, tryb jasny/ciemny) **serwowany przez
|
||||||
`buildSitemapXml` — przeglądarka pokaże wbudowane drzewo XML (wcięcia, zwijanie,
|
plugin z tej samej trasy** (`/sitemap.xml?style`). Projekt nie ma `sitemap.css`,
|
||||||
kolorowanie składni), bez żadnej transformacji.
|
nic nie kopiuje z `node_modules`, nie podaje `cssUrl`. Cały plik trasy:
|
||||||
|
|
||||||
> **NIE używaj XSLT.** Przeglądarki (Chrome i in.) WYCOFUJĄ XSLT — arkusz
|
|
||||||
> `<?xml-stylesheet?>` pokazuje ostrzeżenie i wkrótce przestanie działać.
|
|
||||||
> Rozwiązanie: serwuj czysty XML z poprawnym Content-Type; przeglądarka
|
|
||||||
> renderuje swój natywny widok drzewa XML sama.
|
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
// app/sitemap.xml/route.ts (zamiast app/sitemap.ts)
|
// src/app/sitemap.xml/route.ts
|
||||||
import { buildSitemapXml } from '@intecion/ipal-kit'
|
export { sitemapRoute as GET } from '@/lib/content'
|
||||||
import { sitemap } from '@/lib/content'
|
|
||||||
|
|
||||||
export const dynamic = 'force-dynamic'
|
export const dynamic = 'force-dynamic'
|
||||||
|
|
||||||
export async function GET() {
|
|
||||||
const entries = await sitemap()
|
|
||||||
const xml = buildSitemapXml(entries)
|
|
||||||
return new Response(xml, {
|
|
||||||
headers: { 'Content-Type': 'application/xml; charset=utf-8' },
|
|
||||||
})
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
`buildSitemapXml` zwraca wcięty XML. Dwa tryby wyświetlania:
|
- **Nagłówek** = `siteName` z Site Settings (język domyślny); brak → „XML Sitemap”.
|
||||||
|
- **Linia pod nagłówkiem** = dostawca technologii: „Technology by Intecion.com”.
|
||||||
**Bez `cssUrl`** → przeglądarka pokazuje natywny widok drzewa XML (wcięcia, zwijanie).
|
- To CSS na XML (`<?xml-stylesheet type="text/css"?>`, standard W3C) — **nie XSLT**,
|
||||||
|
które przeglądarki wycofują. Google ignoruje dyrektywę; zero wpływu na SEO.
|
||||||
**Z `cssUrl`** → stylujesz XML własnym CSS (kafelki, etykiety). To W3C standard
|
|
||||||
„Associating Style Sheets with XML" — `type="text/css"`, NIE wycofywane (w
|
|
||||||
przeciwieństwie do XSLT/`text/xsl`). Zero ostrzeżenia, ładny wygląd, bezpieczne
|
|
||||||
dla Google (crawlery ignorują dyrektywę).
|
|
||||||
|
|
||||||
|
Zmiana wyglądu — raz, w `lib/content.ts`, nie w plikach:
|
||||||
```ts
|
```ts
|
||||||
const xml = buildSitemapXml(entries, { cssUrl: '/sitemap.css' })
|
createContentHelpers({
|
||||||
|
config, content, i18n: i18nConfig,
|
||||||
|
sitemapStyle: { accent: '#0f766e' }, // kolor akcentu
|
||||||
|
// sitemapStyle: { credit: false }, // bez linii dostawcy
|
||||||
|
// sitemapStyle: { title: 'Sitemap' }, // stały nagłówek zamiast siteName
|
||||||
|
// sitemapStyle: false, // surowy XML (natywny widok przeglądarki)
|
||||||
|
// siteNameField: 'name', // gdy pole nazwy w Site Settings ma inną nazwę
|
||||||
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
### Gotowy CSS z pluginu
|
Niższy poziom (bez `createContentHelpers`): `createSitemapRouteHandler(sitemap, { style })`,
|
||||||
|
`buildSitemapXml(entries, { cssUrl })`, `buildSitemapCss(options)`. Opcja `cssUrl`
|
||||||
Plugin dostarcza dopracowany `sitemap.css` (auto dark/light, kafelki, pigułki
|
(własny arkusz w `public/`) nadal działa, ale nie jest potrzebna.
|
||||||
hreflang, monospace URL). Skopiuj do projektu:
|
|
||||||
```bash
|
|
||||||
cp node_modules/@intecion/ipal-kit/dist/modules/seo/assets/sitemap.css public/sitemap.css
|
|
||||||
```
|
|
||||||
Dostosuj `--accent` i inne zmienne CSS do brandingu projektu. Selektory to nazwy
|
|
||||||
tagów XML (`urlset`, `url`, `loc`, `lastmod`, `link`). hreflang pokazuje się jako
|
|
||||||
pigułka przez `link::before { content: attr(hreflang) }`.
|
|
||||||
|
|
||||||
|
|
||||||
### WAŻNE — jeden sitemap, nie dwa
|
### WAŻNE — jeden sitemap, nie dwa
|
||||||
|
|
||||||
Jeśli używasz `app/sitemap.xml/route.ts`, USUŃ `app/sitemap.ts` (MetadataRoute).
|
Jeśli używasz `app/sitemap.xml/route.ts`, USUŃ `app/sitemap.ts` (MetadataRoute).
|
||||||
Dwa sitemapy pod różnymi ścieżkami mylą crawlery. Wybierz jeden:
|
Dwa sitemapy pod różnymi ścieżkami mylą crawlery. Wybierz jeden:
|
||||||
- **route.ts + buildSitemapXml** — czytelny XML w przeglądarce
|
- **`sitemap.xml/route.ts` + `sitemapRoute`** (zalecane) — czytelny w przeglądarce, wygląd z pluginu
|
||||||
- **sitemap.ts** (reeksport z lib/content) — mniej kodu, mniej czytelny w przeglądarce
|
- **`sitemap.ts`** (`export { sitemap as default }`) — natywny widok XML przeglądarki
|
||||||
|
|
||||||
Oba tak samo dobre dla Google — to kwestia czytelności dla człowieka, nie SEO.
|
Oba tak samo dobre dla Google — to kwestia czytelności dla człowieka, nie SEO.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@intecion/ipal-kit",
|
"name": "@intecion/ipal-kit",
|
||||||
"version": "1.8.4",
|
"version": "1.8.5",
|
||||||
"description": "Intecion Payload Advanced Library — a Payload CMS 3 plugin: i18n, SEO, forms, consent, analytics, blog/archives.",
|
"description": "Intecion Payload Advanced Library — a Payload CMS 3 plugin: i18n, SEO, forms, consent, analytics, blog/archives.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
+138
-137
@@ -1,20 +1,3 @@
|
|||||||
export { ipalKit } from './plugin.js'
|
|
||||||
export type { IpalOptions } from './types.js'
|
|
||||||
export type { I18nConfig, LocaleDefinition, LocalizedSlugs } from './modules/i18n/index.js'
|
|
||||||
export {
|
|
||||||
buildLocalizedPath,
|
|
||||||
getDefaultLocale,
|
|
||||||
getLocaleCodes,
|
|
||||||
getLocaleDefinition,
|
|
||||||
getLocalizedSlugs,
|
|
||||||
isValidLocale,
|
|
||||||
LOCALE_COOKIE_NAME,
|
|
||||||
matchAcceptLanguage,
|
|
||||||
negotiateLocale,
|
|
||||||
switchLocalePath,
|
|
||||||
} from './modules/i18n/index.js'
|
|
||||||
export type { PagesOption, SystemPageRole } from './modules/pages/index.js'
|
|
||||||
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js'
|
|
||||||
export type { AccessOption, Role } from './modules/access/index.js'
|
export type { AccessOption, Role } from './modules/access/index.js'
|
||||||
export {
|
export {
|
||||||
adminOnly,
|
adminOnly,
|
||||||
@@ -30,58 +13,102 @@ export {
|
|||||||
requireRoleField,
|
requireRoleField,
|
||||||
ROLE_HIERARCHY,
|
ROLE_HIERARCHY,
|
||||||
} from './modules/access/index.js'
|
} from './modules/access/index.js'
|
||||||
export type { GlobalQueryOptions } from './modules/payload/index.js'
|
export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js'
|
||||||
|
export type { A11yState } from './modules/accessibility/index.js'
|
||||||
|
export { rowLabel } from './modules/admin-ui/index.js'
|
||||||
|
export type { RowLabelProps } from './modules/admin-ui/index.js'
|
||||||
|
export type { AnalyticsConfig } from './modules/analytics/index.js'
|
||||||
|
export { getAnalyticsConfig } from './modules/analytics/index.js'
|
||||||
export {
|
export {
|
||||||
getGlobal,
|
ACCEPT_ALL_CONSENT,
|
||||||
getSiteSettings,
|
CONSENT_CATEGORIES,
|
||||||
getSiteIntegrations,
|
CONSENT_COOKIE,
|
||||||
SITE_SETTINGS_SLUG,
|
CONSENT_MAX_AGE,
|
||||||
SITE_INTEGRATIONS_SLUG,
|
CONSENT_VERSION,
|
||||||
} from './modules/payload/index.js'
|
DEFAULT_CONSENT,
|
||||||
export type { SeoOption, SeoMeta, PageMetadata } from './modules/seo/index.js'
|
getConsentTexts,
|
||||||
|
parseConsent,
|
||||||
|
REJECT_ALL_CONSENT,
|
||||||
|
serializeConsent,
|
||||||
|
setDefaultConsent,
|
||||||
|
updateConsent,
|
||||||
|
} from './modules/consent/index.js'
|
||||||
|
export type { ConsentCategory, ConsentState, ConsentTexts } from './modules/consent/index.js'
|
||||||
|
export type { ContentCollectionOption, ContentOption, ResolvedRoute } from './modules/content/index.js'
|
||||||
export {
|
export {
|
||||||
composeTitle,
|
|
||||||
buildHreflangAlternates,
|
|
||||||
buildMetadata,
|
|
||||||
readSiteMetaConfig,
|
|
||||||
slugsAcrossLocales,
|
|
||||||
} from './modules/seo/index.js'
|
|
||||||
export type { SiteMetaConfig } from './modules/seo/index.js'
|
|
||||||
export type { ContentOption, ContentCollectionOption, ResolvedRoute } from './modules/content/index.js'
|
|
||||||
export { createContentHelpers } from './modules/frontend/index.js'
|
|
||||||
export {
|
|
||||||
resolveRoute,
|
|
||||||
resolveRedirect,
|
|
||||||
resolveNotFoundPage,
|
|
||||||
blocksToMarkdown,
|
|
||||||
createMarkdownRenderer,
|
|
||||||
markdownResponse,
|
|
||||||
prefersMarkdown,
|
|
||||||
markdownHref,
|
|
||||||
MARKDOWN_PREFIX,
|
|
||||||
searchContent,
|
|
||||||
createSearchRoute,
|
|
||||||
archiveFieldName,
|
archiveFieldName,
|
||||||
getArchiveEntries,
|
blocksToMarkdown,
|
||||||
buildArchivePath,
|
buildArchivePath,
|
||||||
buildEntryPath,
|
buildEntryPath,
|
||||||
|
createMarkdownRenderer,
|
||||||
|
createSearchRoute,
|
||||||
|
getArchiveEntries,
|
||||||
|
MARKDOWN_PREFIX,
|
||||||
|
markdownHref,
|
||||||
|
markdownResponse,
|
||||||
parsePageParam,
|
parsePageParam,
|
||||||
|
prefersMarkdown,
|
||||||
|
resolveNotFoundPage,
|
||||||
|
resolveRedirect,
|
||||||
|
resolveRoute,
|
||||||
|
searchContent,
|
||||||
} from './modules/content/index.js'
|
} from './modules/content/index.js'
|
||||||
export type { ArchiveEntries } from './modules/content/index.js'
|
export type { ArchiveEntries } from './modules/content/index.js'
|
||||||
export type { SearchResult } from './modules/content/index.js'
|
export type { SearchResult } from './modules/content/index.js'
|
||||||
// Lexical → Markdown (pure, no React) — for AI-readable output.
|
export { graphAdapter } from './modules/email/graphAdapter.js'
|
||||||
export { lexicalToMarkdown } from './modules/richtext/index.js'
|
export type { GraphAdapterArgs } from './modules/email/graphAdapter.js'
|
||||||
export type { AutoFillMapping, SitemapEntry, RobotsRules, RobotsOptions } from './modules/seo/index.js'
|
export { mailAdapter } from './modules/email/mailAdapter.js'
|
||||||
|
export type { MailAdapterArgs } from './modules/email/mailAdapter.js'
|
||||||
|
// Imported straight from the file, NOT from ./modules/email/index.js — that
|
||||||
|
// barrel re-exports sendEmail, which imports 'server-only' and would crash when
|
||||||
|
// Payload loads the config (or runs generate:importmap) as a plain Node script.
|
||||||
|
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js'
|
||||||
|
export type { PanelSmtpAdapterArgs } from './modules/email/panelSmtpAdapter.js'
|
||||||
|
// Boot-time environment validation (fail fast on misconfigured deploys).
|
||||||
|
export { assertEnv, ipalEnvRules } from './modules/env/index.js'
|
||||||
|
export type { AssertEnvOptions, EnvKind, EnvRule, IpalEnvFeatures } from './modules/env/index.js'
|
||||||
|
// Panel-managed form analytics (config-time field builder).
|
||||||
|
export { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js'
|
||||||
|
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js'
|
||||||
|
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js'
|
||||||
|
export type {
|
||||||
|
FormsCollectionOverrides,
|
||||||
|
FormsFieldsOverride,
|
||||||
|
FormsOption,
|
||||||
|
} from './modules/forms/types.js'
|
||||||
|
export type { FormErrors, FormSubmitAction, Validator } from './modules/forms/useForm.js'
|
||||||
|
// Validation rules are pure — exported server-side too, for re-validating a
|
||||||
|
// submission inside a server action. (useForm/useContactForm are client-only →
|
||||||
|
// '@intecion/ipal-kit/client'.)
|
||||||
export {
|
export {
|
||||||
buildAutoFillMetaHook,
|
buildValidator,
|
||||||
injectAutoFillMeta,
|
checked,
|
||||||
createMetadataGenerator,
|
custom,
|
||||||
createPageMetadata,
|
email,
|
||||||
buildSitemapEntries,
|
isEmail,
|
||||||
buildRobots,
|
maxLength,
|
||||||
AI_ASSISTANT_BOTS,
|
minLength,
|
||||||
AI_TRAINING_BOTS,
|
pattern,
|
||||||
} from './modules/seo/index.js'
|
required,
|
||||||
|
} from './modules/forms/validators.js'
|
||||||
|
export type { Rule } from './modules/forms/validators.js'
|
||||||
|
export { createContentHelpers } from './modules/frontend/index.js'
|
||||||
|
// Healthcheck route (Coolify/Docker liveness with a real DB round-trip).
|
||||||
|
export { createHealthRoute } from './modules/health/index.js'
|
||||||
|
export { buildCrossLocaleFieldSync, buildPreventDeleteSystemPage, buildRevalidateHook, buildValidateUniqueRole, setPublishedAtHook, trackSlugHistoryHook } from './modules/hooks/index.js'
|
||||||
|
export type { I18nConfig, LocaleDefinition, LocalizedSlugs } from './modules/i18n/index.js'
|
||||||
|
export {
|
||||||
|
buildLocalizedPath,
|
||||||
|
getDefaultLocale,
|
||||||
|
getLocaleCodes,
|
||||||
|
getLocaleDefinition,
|
||||||
|
getLocalizedSlugs,
|
||||||
|
isValidLocale,
|
||||||
|
LOCALE_COOKIE_NAME,
|
||||||
|
matchAcceptLanguage,
|
||||||
|
negotiateLocale,
|
||||||
|
switchLocalePath,
|
||||||
|
} from './modules/i18n/index.js'
|
||||||
export type { LocaleMiddlewareResult } from './modules/i18n/index.js'
|
export type { LocaleMiddlewareResult } from './modules/i18n/index.js'
|
||||||
export {
|
export {
|
||||||
createLocaleMiddleware,
|
createLocaleMiddleware,
|
||||||
@@ -89,96 +116,70 @@ export {
|
|||||||
} from './modules/i18n/index.js'
|
} from './modules/i18n/index.js'
|
||||||
export { createProxy, DEFAULT_PROXY_MATCHER } from './modules/i18n/index.js'
|
export { createProxy, DEFAULT_PROXY_MATCHER } from './modules/i18n/index.js'
|
||||||
export { resolveLocalized } from './modules/i18n/index.js'
|
export { resolveLocalized } from './modules/i18n/index.js'
|
||||||
export {
|
export { buildLinkField, buildLinksField, resolveLinkHref } from './modules/links/index.js'
|
||||||
CONSENT_CATEGORIES,
|
|
||||||
DEFAULT_CONSENT,
|
|
||||||
ACCEPT_ALL_CONSENT,
|
|
||||||
REJECT_ALL_CONSENT,
|
|
||||||
CONSENT_COOKIE,
|
|
||||||
CONSENT_VERSION,
|
|
||||||
CONSENT_MAX_AGE,
|
|
||||||
serializeConsent,
|
|
||||||
parseConsent,
|
|
||||||
setDefaultConsent,
|
|
||||||
updateConsent,
|
|
||||||
getConsentTexts,
|
|
||||||
} from './modules/consent/index.js'
|
|
||||||
export type { ConsentCategory, ConsentState, ConsentTexts } from './modules/consent/index.js'
|
|
||||||
// Imported straight from the file, NOT from ./modules/email/index.js — that
|
|
||||||
// barrel re-exports sendEmail, which imports 'server-only' and would crash when
|
|
||||||
// Payload loads the config (or runs generate:importmap) as a plain Node script.
|
|
||||||
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js'
|
|
||||||
export { graphAdapter } from './modules/email/graphAdapter.js'
|
|
||||||
export { mailAdapter } from './modules/email/mailAdapter.js'
|
|
||||||
export type { MailAdapterArgs } from './modules/email/mailAdapter.js'
|
|
||||||
export type { GraphAdapterArgs } from './modules/email/graphAdapter.js'
|
|
||||||
export type { PanelSmtpAdapterArgs } from './modules/email/panelSmtpAdapter.js'
|
|
||||||
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js'
|
|
||||||
export type {
|
export type {
|
||||||
FormsOption,
|
BuildLinkFieldOptions,
|
||||||
FormsCollectionOverrides,
|
BuildLinksFieldOptions,
|
||||||
FormsFieldsOverride,
|
LinkAppearance,
|
||||||
} from './modules/forms/types.js'
|
LinkValue,
|
||||||
// Validation rules are pure — exported server-side too, for re-validating a
|
ResolveLinkHrefOptions,
|
||||||
// submission inside a server action. (useForm/useContactForm are client-only →
|
} from './modules/links/index.js'
|
||||||
// '@intecion/ipal-kit/client'.)
|
|
||||||
export {
|
|
||||||
buildValidator,
|
|
||||||
isEmail,
|
|
||||||
required,
|
|
||||||
email,
|
|
||||||
minLength,
|
|
||||||
maxLength,
|
|
||||||
checked,
|
|
||||||
pattern,
|
|
||||||
custom,
|
|
||||||
} from './modules/forms/validators.js'
|
|
||||||
export type { Rule } from './modules/forms/validators.js'
|
|
||||||
export type { FormErrors, FormSubmitAction, Validator } from './modules/forms/useForm.js'
|
|
||||||
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js'
|
|
||||||
// Panel-managed form analytics (config-time field builder).
|
|
||||||
export { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js'
|
|
||||||
// Healthcheck route (Coolify/Docker liveness with a real DB round-trip).
|
|
||||||
export { createHealthRoute } from './modules/health/index.js'
|
|
||||||
// Read-only MCP server (Claude/agents connect to the site and query it).
|
// Read-only MCP server (Claude/agents connect to the site and query it).
|
||||||
export { createMcpRoute } from './modules/mcp/index.js'
|
export { createMcpRoute } from './modules/mcp/index.js'
|
||||||
// Boot-time environment validation (fail fast on misconfigured deploys).
|
export { buildOptimizeUploadField, buildOptimizeUploadHook, normalizeFilename, normalizeFilenameHook } from './modules/media/index.js'
|
||||||
export { assertEnv, ipalEnvRules } from './modules/env/index.js'
|
export type { OptimizeUploadOptions } from './modules/media/index.js'
|
||||||
export type { EnvRule, EnvKind, AssertEnvOptions, IpalEnvFeatures } from './modules/env/index.js'
|
export { getNotificationTexts, NOTIFICATION_FALLBACK, resolveFormMessage } from './modules/notifications/index.js'
|
||||||
export type { AnalyticsConfig } from './modules/analytics/index.js'
|
export type { FormNotificationTexts, NotificationTexts } from './modules/notifications/index.js'
|
||||||
export { getAnalyticsConfig } from './modules/analytics/index.js'
|
export type { PagesOption, SystemPageRole } from './modules/pages/index.js'
|
||||||
export { buildSlugField, toSlug } from './modules/slug/index.js'
|
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js'
|
||||||
export { createLlmsTxtRoute, createSitemapRouteHandler, createManifestHandler } from './modules/seo/index.js'
|
export type { GlobalQueryOptions } from './modules/payload/index.js'
|
||||||
|
|
||||||
export { getNotificationTexts, resolveFormMessage, NOTIFICATION_FALLBACK } from './modules/notifications/index.js'
|
export {
|
||||||
|
getGlobal,
|
||||||
|
getSiteIntegrations,
|
||||||
|
getSiteSettings,
|
||||||
|
SITE_INTEGRATIONS_SLUG,
|
||||||
|
SITE_SETTINGS_SLUG,
|
||||||
|
} from './modules/payload/index.js'
|
||||||
|
// Lexical → Markdown (pure, no React) — for AI-readable output.
|
||||||
|
export { lexicalToMarkdown } from './modules/richtext/index.js'
|
||||||
export { buildSecurityHeaders } from './modules/security/index.js'
|
export { buildSecurityHeaders } from './modules/security/index.js'
|
||||||
export { buildCsp } from './modules/security/index.js'
|
export { buildCsp } from './modules/security/index.js'
|
||||||
export type { BuildCspArgs } from './modules/security/index.js'
|
export type { BuildCspArgs } from './modules/security/index.js'
|
||||||
|
export type { BuildSecurityHeadersArgs, SecurityHeader } from './modules/security/index.js'
|
||||||
|
export type { PageMetadata, SeoMeta, SeoOption } from './modules/seo/index.js'
|
||||||
|
export {
|
||||||
|
buildHreflangAlternates,
|
||||||
|
buildMetadata,
|
||||||
|
composeTitle,
|
||||||
|
readSiteMetaConfig,
|
||||||
|
slugsAcrossLocales,
|
||||||
|
} from './modules/seo/index.js'
|
||||||
|
export type { SiteMetaConfig } from './modules/seo/index.js'
|
||||||
|
export type { AutoFillMapping, RobotsOptions, RobotsRules, SitemapEntry } from './modules/seo/index.js'
|
||||||
|
export {
|
||||||
|
AI_ASSISTANT_BOTS,
|
||||||
|
AI_TRAINING_BOTS,
|
||||||
|
buildAutoFillMetaHook,
|
||||||
|
buildRobots,
|
||||||
|
buildSitemapEntries,
|
||||||
|
createMetadataGenerator,
|
||||||
|
createPageMetadata,
|
||||||
|
injectAutoFillMeta,
|
||||||
|
} from './modules/seo/index.js'
|
||||||
|
export { createLlmsTxtRoute, createManifestHandler, createSitemapRouteHandler } from './modules/seo/index.js'
|
||||||
export { buildIconsMetadata, buildOrganizationJsonLd, validateFaviconField } from './modules/seo/index.js'
|
export { buildIconsMetadata, buildOrganizationJsonLd, validateFaviconField } from './modules/seo/index.js'
|
||||||
export { buildNoindexField } from './modules/seo/index.js'
|
export { buildNoindexField } from './modules/seo/index.js'
|
||||||
export { rowLabel } from './modules/admin-ui/index.js'
|
|
||||||
export type { RowLabelProps } from './modules/admin-ui/index.js'
|
|
||||||
export { buildLinkField, buildLinksField, resolveLinkHref } from './modules/links/index.js'
|
|
||||||
export type {
|
|
||||||
LinkAppearance,
|
|
||||||
LinkValue,
|
|
||||||
BuildLinkFieldOptions,
|
|
||||||
BuildLinksFieldOptions,
|
|
||||||
ResolveLinkHrefOptions,
|
|
||||||
} from './modules/links/index.js'
|
|
||||||
export { buildSpeakableJsonLd } from './modules/seo/index.js'
|
export { buildSpeakableJsonLd } from './modules/seo/index.js'
|
||||||
export { buildSummaryField } from './modules/seo/index.js'
|
export { buildSummaryField } from './modules/seo/index.js'
|
||||||
export { buildWebSiteJsonLd, buildBreadcrumbJsonLd, buildSiteNavigationJsonLd } from './modules/seo/index.js'
|
export { buildBreadcrumbJsonLd, buildSiteNavigationJsonLd, buildWebSiteJsonLd } from './modules/seo/index.js'
|
||||||
// Local SEO structured data — LocalBusiness (map pack), Service (offering), FAQPage.
|
// Local SEO structured data — LocalBusiness (map pack), Service (offering), FAQPage.
|
||||||
export { buildLocalBusinessJsonLd, buildFaqJsonLd, buildServiceJsonLd } from './modules/seo/index.js'
|
export { buildFaqJsonLd, buildLocalBusinessJsonLd, buildServiceJsonLd } from './modules/seo/index.js'
|
||||||
export { buildArticleJsonLd } from './modules/seo/index.js'
|
export { buildArticleJsonLd } from './modules/seo/index.js'
|
||||||
export { buildLlmsTxt } from './modules/seo/index.js'
|
export { buildLlmsTxt } from './modules/seo/index.js'
|
||||||
export { buildSitemapXml } from './modules/seo/index.js'
|
export { buildSitemapCss, buildSitemapXml, DEFAULT_SITEMAP_CREDIT, SITEMAP_STYLE_PARAM } from './modules/seo/index.js'
|
||||||
|
export type { SitemapRouteOptions, SitemapStyleOptions } from './modules/seo/index.js'
|
||||||
|
export { buildSlugField, toSlug } from './modules/slug/index.js'
|
||||||
export { buildR2Storage } from './modules/storage/index.js'
|
export { buildR2Storage } from './modules/storage/index.js'
|
||||||
export { normalizeFilename, normalizeFilenameHook, buildOptimizeUploadHook, buildOptimizeUploadField } from './modules/media/index.js'
|
export { ipalKit } from './plugin.js'
|
||||||
export type { OptimizeUploadOptions } from './modules/media/index.js'
|
export type { IpalOptions } from './types.js'
|
||||||
export { buildRevalidateHook, setPublishedAtHook, buildPreventDeleteSystemPage, buildValidateUniqueRole, trackSlugHistoryHook, buildCrossLocaleFieldSync } from './modules/hooks/index.js'
|
|
||||||
export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js'
|
|
||||||
export type { A11yState } from './modules/accessibility/index.js'
|
|
||||||
export type { SecurityHeader, BuildSecurityHeadersArgs } from './modules/security/index.js'
|
|
||||||
export type { NotificationTexts, FormNotificationTexts } from './modules/notifications/index.js'
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import { cache } from 'react'
|
|||||||
|
|
||||||
import type { ArchiveEntries, ContentOption, ResolvedRoute } from '../content/index.js'
|
import type { ArchiveEntries, ContentOption, ResolvedRoute } from '../content/index.js'
|
||||||
import type { I18nConfig } from '../i18n/index.js'
|
import type { I18nConfig } from '../i18n/index.js'
|
||||||
import type { PageMetadata, RobotsOptions, RobotsRules, SitemapEntry } from '../seo/index.js'
|
import type { PageMetadata, RobotsOptions, RobotsRules, SitemapEntry, SitemapStyleOptions } from '../seo/index.js'
|
||||||
|
|
||||||
import { getArchiveEntries, resolveRoute as resolveRouteRaw } from '../content/index.js'
|
import { getArchiveEntries, resolveRoute as resolveRouteRaw } from '../content/index.js'
|
||||||
import { buildRobots, buildSitemapEntries, createPageMetadata } from '../seo/index.js'
|
import { buildRobots, buildSitemapEntries, createPageMetadata, createSitemapRouteHandler } from '../seo/index.js'
|
||||||
|
|
||||||
type CreateContentHelpersArgs = {
|
type CreateContentHelpersArgs = {
|
||||||
/**
|
/**
|
||||||
@@ -39,6 +39,14 @@ type CreateContentHelpersArgs = {
|
|||||||
robots?: RobotsOptions
|
robots?: RobotsOptions
|
||||||
/** SiteSettings global slug. Defaults to 'site-settings'. */
|
/** SiteSettings global slug. Defaults to 'site-settings'. */
|
||||||
settingsSlug?: string
|
settingsSlug?: string
|
||||||
|
/**
|
||||||
|
* Browser look of `sitemapRoute` (/sitemap.xml). Default: built-in style,
|
||||||
|
* header = Site Settings `siteName` (default locale), credit "Technology by
|
||||||
|
* Intecion.com". `false` = raw XML. `{ credit: false }` hides the credit line.
|
||||||
|
*/
|
||||||
|
sitemapStyle?: { title?: string } & Omit<SitemapStyleOptions, 'title'> | false
|
||||||
|
/** Site Settings field with the site name (sitemap header). Default 'siteName'. */
|
||||||
|
siteNameField?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,6 +83,8 @@ export function createContentHelpers({
|
|||||||
pagesSlug = 'pages',
|
pagesSlug = 'pages',
|
||||||
robots: robotsOptions,
|
robots: robotsOptions,
|
||||||
settingsSlug = 'site-settings',
|
settingsSlug = 'site-settings',
|
||||||
|
sitemapStyle,
|
||||||
|
siteNameField = 'siteName',
|
||||||
}: CreateContentHelpersArgs) {
|
}: CreateContentHelpersArgs) {
|
||||||
const origin = baseUrl ?? process.env.NEXT_PUBLIC_SERVER_URL ?? ''
|
const origin = baseUrl ?? process.env.NEXT_PUBLIC_SERVER_URL ?? ''
|
||||||
const getCachedPayload = cache(
|
const getCachedPayload = cache(
|
||||||
@@ -384,6 +394,31 @@ export function createContentHelpers({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Route handler for app/sitemap.xml/route.ts — XML for crawlers, styled for
|
||||||
|
* people (`?style` serves the CSS from the plugin; nothing in /public):
|
||||||
|
*
|
||||||
|
* export { sitemapRoute as GET } from '@/lib/content'
|
||||||
|
* export const dynamic = 'force-dynamic'
|
||||||
|
*/
|
||||||
|
const sitemapRoute = createSitemapRouteHandler(sitemap, {
|
||||||
|
style:
|
||||||
|
sitemapStyle === false
|
||||||
|
? false
|
||||||
|
: {
|
||||||
|
...sitemapStyle,
|
||||||
|
title:
|
||||||
|
sitemapStyle?.title ??
|
||||||
|
(async () => {
|
||||||
|
const locale = i18n?.defaultLocale
|
||||||
|
if (!locale) {return undefined}
|
||||||
|
const s = (await getSettings(locale)) as Record<string, unknown>
|
||||||
|
const name = s?.[siteNameField]
|
||||||
|
return typeof name === 'string' ? name : undefined
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
generatePageMetadata,
|
generatePageMetadata,
|
||||||
generateStaticParams,
|
generateStaticParams,
|
||||||
@@ -395,5 +430,6 @@ export function createContentHelpers({
|
|||||||
resolveRoute,
|
resolveRoute,
|
||||||
robots,
|
robots,
|
||||||
sitemap,
|
sitemap,
|
||||||
|
sitemapRoute,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+33
-30
@@ -1,38 +1,41 @@
|
|||||||
export { buildAutoFillMetaHook } from './autoFillMeta.js'
|
export type { SeoOption, SeoMeta } from './types.js'
|
||||||
export type { AutoFillMapping } from './autoFillMeta.js'
|
export { composeTitle } from './composeTitle.js'
|
||||||
export { buildArticleJsonLd } from './buildArticleJsonLd.js'
|
export type { TitleOrder } from './composeTitle.js'
|
||||||
export { buildBreadcrumbJsonLd } from './buildBreadcrumbJsonLd.js'
|
export { buildHreflangAlternates } from './hreflang.js'
|
||||||
export { buildFaqJsonLd } from './buildFaqJsonLd.js'
|
|
||||||
export { buildIconsMetadata } from './buildIconsMetadata.js'
|
|
||||||
export { buildLlmsTxt } from './buildLlmsTxt.js'
|
|
||||||
export { buildLocalBusinessJsonLd } from './buildLocalBusinessJsonLd.js'
|
|
||||||
export { createManifestHandler } from './buildManifest.js'
|
|
||||||
export { buildMetadata } from './buildMetadata.js'
|
export { buildMetadata } from './buildMetadata.js'
|
||||||
export type { PageMetadata } from './buildMetadata.js'
|
export type { PageMetadata } from './buildMetadata.js'
|
||||||
export { buildNoindexField } from './buildNoindexField.js'
|
export { buildSeoPlugin } from './seoPluginConfig.js'
|
||||||
export { buildOrganizationJsonLd } from './buildOrganizationJsonLd.js'
|
export { buildAutoFillMetaHook } from './autoFillMeta.js'
|
||||||
export { AI_ASSISTANT_BOTS, AI_TRAINING_BOTS, buildRobots } from './buildRobots.js'
|
export { injectAutoFillMeta } from './injectAutoFillMeta.js'
|
||||||
export type { RobotsOptions, RobotsRules } from './buildRobots.js'
|
export { injectSeoTabs } from './injectSeoTabs.js'
|
||||||
export { buildServiceJsonLd } from './buildServiceJsonLd.js'
|
export type { AutoFillMapping } from './autoFillMeta.js'
|
||||||
|
export { createMetadataGenerator } from './createMetadataGenerator.js'
|
||||||
|
export { createPageMetadata } from './createPageMetadata.js'
|
||||||
|
export { readSiteMetaConfig } from './readSiteMetaConfig.js'
|
||||||
|
export type { SiteMetaConfig } from './readSiteMetaConfig.js'
|
||||||
|
export { slugsAcrossLocales } from './slugsAcrossLocales.js'
|
||||||
export { buildSitemapEntries } from './buildSitemapEntries.js'
|
export { buildSitemapEntries } from './buildSitemapEntries.js'
|
||||||
export type { SitemapEntry } from './buildSitemapEntries.js'
|
|
||||||
export { buildSitemapXml } from './buildSitemapXml.js'
|
export { buildSitemapXml } from './buildSitemapXml.js'
|
||||||
export { buildSiteNavigationJsonLd } from './buildSiteNavigationJsonLd.js'
|
export type { SitemapEntry } from './buildSitemapEntries.js'
|
||||||
|
export { buildRobots, AI_ASSISTANT_BOTS, AI_TRAINING_BOTS } from './buildRobots.js'
|
||||||
|
export type { RobotsRules, RobotsOptions } from './buildRobots.js'
|
||||||
|
export { buildIconsMetadata } from './buildIconsMetadata.js'
|
||||||
|
export { buildOrganizationJsonLd } from './buildOrganizationJsonLd.js'
|
||||||
|
export { validateFaviconField } from './validateFavicon.js'
|
||||||
|
export { buildNoindexField } from './buildNoindexField.js'
|
||||||
export { buildSpeakableJsonLd } from './buildSpeakableJsonLd.js'
|
export { buildSpeakableJsonLd } from './buildSpeakableJsonLd.js'
|
||||||
export { buildSummaryField } from './buildSummaryField.js'
|
export { buildSummaryField } from './buildSummaryField.js'
|
||||||
export { buildWebSiteJsonLd } from './buildWebSiteJsonLd.js'
|
export { buildWebSiteJsonLd } from './buildWebSiteJsonLd.js'
|
||||||
export { composeTitle } from './composeTitle.js'
|
export { buildBreadcrumbJsonLd } from './buildBreadcrumbJsonLd.js'
|
||||||
export type { TitleOrder } from './composeTitle.js'
|
export { buildSiteNavigationJsonLd } from './buildSiteNavigationJsonLd.js'
|
||||||
export { createMetadataGenerator } from './createMetadataGenerator.js'
|
export { buildLocalBusinessJsonLd } from './buildLocalBusinessJsonLd.js'
|
||||||
export { createPageMetadata } from './createPageMetadata.js'
|
export { buildFaqJsonLd } from './buildFaqJsonLd.js'
|
||||||
export { buildHreflangAlternates } from './hreflang.js'
|
export { buildServiceJsonLd } from './buildServiceJsonLd.js'
|
||||||
export { injectAutoFillMeta } from './injectAutoFillMeta.js'
|
export { buildArticleJsonLd } from './buildArticleJsonLd.js'
|
||||||
export { injectSeoTabs } from './injectSeoTabs.js'
|
export { buildLlmsTxt } from './buildLlmsTxt.js'
|
||||||
export { JsonLdGraph } from './JsonLdGraph.js'
|
|
||||||
export { readSiteMetaConfig } from './readSiteMetaConfig.js'
|
|
||||||
export type { SiteMetaConfig } from './readSiteMetaConfig.js'
|
|
||||||
export { createLlmsTxtRoute, createSitemapRouteHandler } from './routeHandlers.js'
|
export { createLlmsTxtRoute, createSitemapRouteHandler } from './routeHandlers.js'
|
||||||
export { buildSeoPlugin } from './seoPluginConfig.js'
|
export type { SitemapRouteOptions } from './routeHandlers.js'
|
||||||
export { slugsAcrossLocales } from './slugsAcrossLocales.js'
|
export { buildSitemapCss, SITEMAP_STYLE_PARAM, DEFAULT_SITEMAP_CREDIT } from './sitemapStyle.js'
|
||||||
export type { SeoMeta, SeoOption } from './types.js'
|
export type { SitemapStyleOptions } from './sitemapStyle.js'
|
||||||
export { validateFaviconField } from './validateFavicon.js'
|
export { createManifestHandler } from './buildManifest.js'
|
||||||
|
export { JsonLdGraph } from './JsonLdGraph.js'
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import type { BasePayload } from 'payload'
|
import type { BasePayload } from 'payload'
|
||||||
|
|
||||||
import type { I18nConfig } from '../i18n/index.js'
|
import type { I18nConfig } from '../i18n/index.js'
|
||||||
import type { SitemapEntry } from './buildSitemapEntries.js'
|
|
||||||
|
|
||||||
import { buildLlmsTxt } from './buildLlmsTxt.js'
|
import { buildLlmsTxt } from './buildLlmsTxt.js'
|
||||||
import { buildSitemapXml } from './buildSitemapXml.js'
|
import { buildSitemapXml } from './buildSitemapXml.js'
|
||||||
|
import type { SitemapEntry } from './buildSitemapEntries.js'
|
||||||
|
import { buildSitemapCss, SITEMAP_STYLE_PARAM, type SitemapStyleOptions } from './sitemapStyle.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ready-made Next route handler for /llms.txt. Replaces the ~60-line try/catch
|
* Ready-made Next route handler for /llms.txt. Replaces the ~60-line try/catch
|
||||||
@@ -26,13 +25,13 @@ import { buildSitemapXml } from './buildSitemapXml.js'
|
|||||||
* baseUrl: process.env.NEXT_PUBLIC_SERVER_URL!, full: true })
|
* baseUrl: process.env.NEXT_PUBLIC_SERVER_URL!, full: true })
|
||||||
*/
|
*/
|
||||||
export function createLlmsTxtRoute(opts: {
|
export function createLlmsTxtRoute(opts: {
|
||||||
baseUrl: string
|
|
||||||
config: I18nConfig
|
|
||||||
/** Inline every page's full Markdown (llms-full.txt). Default false. */
|
|
||||||
full?: boolean
|
|
||||||
getCachedPayload: () => Promise<BasePayload>
|
getCachedPayload: () => Promise<BasePayload>
|
||||||
|
config: I18nConfig
|
||||||
|
baseUrl: string
|
||||||
pagesSlug?: string
|
pagesSlug?: string
|
||||||
settingsSlug?: string
|
settingsSlug?: string
|
||||||
|
/** Inline every page's full Markdown (llms-full.txt). Default false. */
|
||||||
|
full?: boolean
|
||||||
/** Field holding a richer AI summary (buildSummaryField) to prefer as description. */
|
/** Field holding a richer AI summary (buildSummaryField) to prefer as description. */
|
||||||
summaryField?: string
|
summaryField?: string
|
||||||
}): () => Promise<Response> {
|
}): () => Promise<Response> {
|
||||||
@@ -40,12 +39,12 @@ export function createLlmsTxtRoute(opts: {
|
|||||||
try {
|
try {
|
||||||
const payload = await opts.getCachedPayload()
|
const payload = await opts.getCachedPayload()
|
||||||
const body = await buildLlmsTxt({
|
const body = await buildLlmsTxt({
|
||||||
baseUrl: opts.baseUrl,
|
|
||||||
config: opts.config,
|
|
||||||
full: opts.full,
|
|
||||||
pagesSlug: opts.pagesSlug,
|
|
||||||
payload,
|
payload,
|
||||||
|
config: opts.config,
|
||||||
|
baseUrl: opts.baseUrl,
|
||||||
|
pagesSlug: opts.pagesSlug,
|
||||||
settingsSlug: opts.settingsSlug,
|
settingsSlug: opts.settingsSlug,
|
||||||
|
full: opts.full,
|
||||||
summaryField: opts.summaryField,
|
summaryField: opts.summaryField,
|
||||||
})
|
})
|
||||||
return new Response(body, {
|
return new Response(body, {
|
||||||
@@ -62,28 +61,58 @@ export function createLlmsTxtRoute(opts: {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type SitemapRouteOptions = {
|
||||||
|
/**
|
||||||
|
* Built-in browser look (default ON): the XML points at `<this route>?style`
|
||||||
|
* and the same handler serves the CSS — nothing to copy into /public.
|
||||||
|
* `false` = raw XML. Object = header/credit/accent (SitemapStyleOptions);
|
||||||
|
* `title` may be async (sitemapRoute passes the Site Settings name).
|
||||||
|
*/
|
||||||
|
style?: false | (Omit<SitemapStyleOptions, 'title'> & { title?: string | (() => Promise<string | undefined>) })
|
||||||
|
/** Legacy: your own stylesheet URL (e.g. '/sitemap.css'). Overrides `style`. */
|
||||||
|
cssUrl?: string
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ready-made Next route handler for /sitemap.xml with the CSS stylesheet.
|
* Ready-made Next route handler for /sitemap.xml, styled for humans out of the box.
|
||||||
* Replaces the hand-written route in every project. Pass the project's `sitemap`
|
* Usually you don't call this — `createContentHelpers` returns `sitemapRoute`:
|
||||||
* helper (from createContentHelpers) and optionally a cssUrl.
|
|
||||||
*
|
*
|
||||||
* // app/sitemap.xml/route.ts
|
* // app/sitemap.xml/route.ts — the whole file
|
||||||
* import { createSitemapRouteHandler } from '@intecion/ipal-kit'
|
* export { sitemapRoute as GET } from '@/lib/content'
|
||||||
* import { sitemap } from '@/lib/content'
|
|
||||||
* export const dynamic = 'force-dynamic'
|
* export const dynamic = 'force-dynamic'
|
||||||
* export const GET = createSitemapRouteHandler(sitemap, { cssUrl: '/sitemap.css' })
|
|
||||||
*
|
*
|
||||||
* Remember: if you use this, DON'T also keep app/sitemap.ts (two sitemaps
|
* `GET /sitemap.xml` → XML (crawlers), `GET /sitemap.xml?style` → its CSS.
|
||||||
* confuse crawlers).
|
* Don't keep app/sitemap.ts next to it — two sitemaps confuse crawlers.
|
||||||
*/
|
*/
|
||||||
export function createSitemapRouteHandler(
|
export function createSitemapRouteHandler(
|
||||||
sitemap: () => Promise<SitemapEntry[]>,
|
sitemap: () => Promise<SitemapEntry[]>,
|
||||||
opts: { cssUrl?: string } = {},
|
opts: SitemapRouteOptions = {},
|
||||||
): () => Promise<Response> {
|
): (req?: Request) => Promise<Response> {
|
||||||
return async () => {
|
const style = opts.cssUrl ? false : opts.style === false ? false : (opts.style ?? {})
|
||||||
|
|
||||||
|
return async (req?: Request) => {
|
||||||
|
const url = req ? new URL(req.url) : null
|
||||||
|
|
||||||
|
if (style && url?.searchParams.has(SITEMAP_STYLE_PARAM)) {
|
||||||
|
let title: string | undefined
|
||||||
|
try {
|
||||||
|
title = typeof style.title === 'function' ? await style.title() : style.title
|
||||||
|
} catch {
|
||||||
|
title = undefined // DB down → generic heading, never a broken stylesheet
|
||||||
|
}
|
||||||
|
return new Response(buildSitemapCss({ ...style, title }), {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'text/css; charset=utf-8',
|
||||||
|
'Cache-Control': 'public, max-age=3600',
|
||||||
|
'X-Robots-Tag': 'noindex',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const cssUrl = opts.cssUrl ?? (style ? `${url?.pathname ?? '/sitemap.xml'}?${SITEMAP_STYLE_PARAM}` : undefined)
|
||||||
try {
|
try {
|
||||||
const entries = await sitemap()
|
const entries = await sitemap()
|
||||||
const xml = buildSitemapXml(entries, { cssUrl: opts.cssUrl })
|
const xml = buildSitemapXml(entries, { cssUrl })
|
||||||
return new Response(xml, {
|
return new Response(xml, {
|
||||||
headers: { 'Content-Type': 'application/xml; charset=utf-8' },
|
headers: { 'Content-Type': 'application/xml; charset=utf-8' },
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -0,0 +1,90 @@
|
|||||||
|
/**
|
||||||
|
* Built-in look of /sitemap.xml in a browser — served by the sitemap route itself
|
||||||
|
* (`/sitemap.xml?style`), so projects ship NO sitemap.css and copy nothing.
|
||||||
|
* Plain CSS on XML (W3C "Associating Style Sheets with XML", type="text/css") —
|
||||||
|
* not XSLT, which browsers are removing. Crawlers ignore it.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export type SitemapStyleOptions = {
|
||||||
|
/** Accent colour (card hover). Default '#027bd0'. Any plain CSS colour. */
|
||||||
|
accent?: string
|
||||||
|
/**
|
||||||
|
* Line under the header — the technology provider. Default
|
||||||
|
* "Technology by Intecion.com". `false` hides it.
|
||||||
|
*/
|
||||||
|
credit?: false | string
|
||||||
|
/** Header line. Default: the site name from Site Settings (sitemapRoute), else "XML Sitemap". */
|
||||||
|
title?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Query parameter on the sitemap URL that returns the stylesheet instead of XML. */
|
||||||
|
export const SITEMAP_STYLE_PARAM = 'style'
|
||||||
|
export const DEFAULT_SITEMAP_CREDIT = 'Technology by Intecion.com'
|
||||||
|
|
||||||
|
/** CSS `content: "…"` value — escapes backslashes, quotes and newlines. */
|
||||||
|
const cssString = (s: string) => `"${s.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/[\r\n]+/g, ' ')}"`
|
||||||
|
|
||||||
|
/** Only plain colour values — the option ends up inside a stylesheet. */
|
||||||
|
const safeColor = (c: string | undefined, fallback: string) =>
|
||||||
|
c && /^(#[0-9a-f]{3,8}|[a-z]+|(rgb|hsl|oklch)a?\([\d\s.,%/-]+\))$/i.test(c.trim()) ? c.trim() : fallback
|
||||||
|
|
||||||
|
export function buildSitemapCss({ accent, credit, title }: SitemapStyleOptions = {}): string {
|
||||||
|
const heading = title?.trim() || 'XML Sitemap'
|
||||||
|
const note = credit === false ? '' : (credit ?? DEFAULT_SITEMAP_CREDIT).trim()
|
||||||
|
const acc = safeColor(accent, '#027bd0')
|
||||||
|
const divider = 'padding-bottom: 1.25rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border);'
|
||||||
|
|
||||||
|
return `:root {
|
||||||
|
--bg: #fafafa; --card: #ffffff; --border: #e5e7eb; --border-hover: #d1d5db;
|
||||||
|
--text-main: #111827; --text-secondary: #4b5563; --text-muted: #9ca3af; --url-color: #1e293b;
|
||||||
|
--badge-bg: #f3f4f6; --badge-border: #e5e7eb; --badge-text: #4b5563; --accent: ${acc};
|
||||||
|
}
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
:root {
|
||||||
|
--bg: #090a0f; --card: #12131a; --border: #1e202e; --border-hover: #2e3247;
|
||||||
|
--text-main: #f9fafb; --text-secondary: #9ca3af; --text-muted: #6b7280; --url-color: #f3f4f6;
|
||||||
|
--badge-bg: #1a1c26; --badge-border: #282b3d; --badge-text: #9ca3af;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
urlset {
|
||||||
|
display: flex; flex-direction: column; box-sizing: border-box; min-height: 100vh;
|
||||||
|
max-width: 1040px; margin: 0 auto; padding: 3rem 1.5rem; line-height: 1.5;
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
|
||||||
|
background-color: var(--bg); color: var(--text-main);
|
||||||
|
}
|
||||||
|
urlset::before {
|
||||||
|
content: ${cssString(heading)};
|
||||||
|
display: block; order: -2; font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em;
|
||||||
|
color: var(--text-main); ${note ? 'padding-bottom: 0.4rem;' : divider}
|
||||||
|
}
|
||||||
|
${note ? `urlset::after {
|
||||||
|
content: ${cssString(note)};
|
||||||
|
display: block; order: -1; font-size: 0.8rem; color: var(--text-muted); ${divider}
|
||||||
|
}
|
||||||
|
` : ''}url {
|
||||||
|
display: block; width: 100%; order: 0; box-sizing: border-box;
|
||||||
|
background-color: var(--card); border: 1px solid var(--border); border-radius: 8px;
|
||||||
|
padding: 1rem 1.25rem; margin-bottom: 0.65rem;
|
||||||
|
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
||||||
|
}
|
||||||
|
url:hover { border-color: var(--accent); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03); }
|
||||||
|
loc {
|
||||||
|
display: block; margin-bottom: 0.45rem; word-break: break-all; line-height: 1.45;
|
||||||
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
||||||
|
font-size: 0.875rem; font-weight: 500; color: var(--url-color);
|
||||||
|
}
|
||||||
|
lastmod, changefreq, priority {
|
||||||
|
display: inline-block; font-size: 0.775rem; color: var(--text-secondary);
|
||||||
|
margin-right: 1.25rem; margin-top: 0.15rem;
|
||||||
|
}
|
||||||
|
lastmod::before { content: "Updated: "; color: var(--text-muted); }
|
||||||
|
changefreq::before { content: "Frequency: "; color: var(--text-muted); }
|
||||||
|
priority::before { content: "Priority: "; color: var(--text-muted); }
|
||||||
|
link {
|
||||||
|
display: inline-block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
|
||||||
|
background-color: var(--badge-bg); border: 1px solid var(--badge-border); color: var(--badge-text);
|
||||||
|
padding: 0.1rem 0.45rem; border-radius: 4px; margin-right: 0.3rem; margin-top: 0.35rem;
|
||||||
|
}
|
||||||
|
link::before { content: attr(hreflang); }
|
||||||
|
`
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user