- Add 4-locale keyword configurations (SR, EN, DE, FR) - Create schema generators (Product, Organization, Breadcrumb) - Add React components for JSON-LD rendering - Implement caching for keyword performance - Abstract all SEO logic for maintainability
59 lines
1.8 KiB
TypeScript
59 lines
1.8 KiB
TypeScript
import { Locale, LocaleKeywords } from '../types';
|
|
|
|
/**
|
|
* Keyword Strategy Configuration
|
|
* Defines how keywords should be used across the site
|
|
*/
|
|
|
|
export const keywordStrategy = {
|
|
density: {
|
|
min: 0.5, // 0.5% minimum keyword density
|
|
max: 2.5, // 2.5% maximum (avoid keyword stuffing)
|
|
optimal: 1.5 // 1.5% optimal density
|
|
},
|
|
|
|
placement: {
|
|
title: true, // Include keyword in page title
|
|
h1: true, // Include keyword in H1
|
|
h2: true, // Include in at least one H2
|
|
firstParagraph: true, // Include in first 100 words
|
|
metaDescription: true, // Include in meta description
|
|
altText: true // Include in image alt text where relevant
|
|
},
|
|
|
|
variations: true, // Use keyword variations/synonyms
|
|
|
|
// Meta title/descriptions character limits
|
|
metaLimits: {
|
|
titleMin: 30,
|
|
titleMax: 60,
|
|
descriptionMin: 120,
|
|
descriptionMax: 160
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Get keyword usage recommendations for a page
|
|
*/
|
|
export function getKeywordRecommendations(
|
|
pageType: keyof LocaleKeywords['pages'],
|
|
locale: Locale
|
|
): { primary: string[]; secondary: string[]; recommendations: string[] } {
|
|
const recommendations: string[] = [
|
|
`Use primary keywords within first 100 words`,
|
|
`Include at least one primary keyword in H1`,
|
|
`Meta title should be ${keywordStrategy.metaLimits.titleMin}-${keywordStrategy.metaLimits.titleMax} characters`,
|
|
`Meta description should be ${keywordStrategy.metaLimits.descriptionMin}-${keywordStrategy.metaLimits.descriptionMax} characters`,
|
|
`Maintain ${keywordStrategy.density.optimal}% keyword density`,
|
|
`Use keyword variations naturally throughout content`
|
|
];
|
|
|
|
return {
|
|
primary: [], // Will be populated by getKeywords
|
|
secondary: [], // Will be populated by getKeywords
|
|
recommendations
|
|
};
|
|
}
|
|
|
|
export default keywordStrategy;
|