UNPKG

@ai-growth/nextjs

Version:

Seamlessly integrate Sanity CMS with Next.js applications for automated blog routing and rendering

73 lines 2.53 kB
/** * @fileoverview SEO Utility Functions * * This module provides utility functions for processing SEO data, * generating meta tags, and creating JSON-LD structured data. */ export * from './meta-tags'; export * from './structured-data'; export * from './content-analysis'; export * from './url-utils'; export * from './image-processing'; import { ExtendedSEO, SEOHeadProps, SEOResult, SEOConfig } from '../../types/seo'; import { SanityPost, SanityPage, SanitySiteSettings } from '../../types/sanity'; /** * Default SEO configuration */ export declare const DEFAULT_SEO_CONFIG: SEOConfig; /** * Process SEO data and generate complete SEO result * * @param props - SEO Head component props * @param config - SEO configuration (optional, uses defaults) * @returns Complete SEO result with meta tags and structured data */ export declare function processSEO(props: SEOHeadProps, config?: Partial<SEOConfig>): SEOResult; /** * Process and merge SEO data from multiple sources with proper fallbacks * * @param content - Content data * @param siteSettings - Site settings * @param customSEO - Custom SEO overrides * @param config - SEO configuration * @returns Processed SEO data */ export declare function processSEOData(content?: SanityPost | SanityPage | any, siteSettings?: SanitySiteSettings, customSEO?: ExtendedSEO, config?: SEOConfig): ExtendedSEO; /** * Sanitize and validate SEO data * * @param seo - SEO data to sanitize * @returns Sanitized SEO data */ export declare function sanitizeSEO(seo: ExtendedSEO): ExtendedSEO; /** * Check if a string is a valid URL * * @param url - URL string to validate * @returns Whether the URL is valid */ export declare function isValidURL(url: string): boolean; /** * Generate SEO-friendly slug from text * * @param text - Text to convert to slug * @returns SEO-friendly slug */ export declare function generateSlug(text: string): string; /** * Extract text content from portable text or HTML * * @param content - Content to extract text from * @param maxLength - Maximum length of extracted text * @returns Extracted text */ export declare function extractTextContent(content: any, maxLength?: number): string; /** * Calculate estimated reading time for content * * @param content - Content to analyze * @param wordsPerMinute - Reading speed (default: 200 wpm) * @returns Estimated reading time in minutes */ export declare function calculateReadingTime(content: any, wordsPerMinute?: number): number; //# sourceMappingURL=index.d.ts.map