Implement Stage 3: Enhance content generation and metadata features
- Updated AI prompts to include metadata context, cluster roles, and product attributes for improved content generation. - Enhanced GenerateContentFunction to incorporate taxonomy and keyword objects for richer context. - Introduced new metadata fields in frontend components for better content organization and filtering. - Added cluster match, taxonomy match, and relevance score to LinkResults for improved link management. - Implemented metadata completeness scoring and recommended actions in AnalysisPreview for better content optimization. - Updated API services to support new metadata structures and site progress tracking.
This commit is contained in:
@@ -5,6 +5,9 @@ interface Link {
|
||||
anchor_text: string;
|
||||
target_content_id: number;
|
||||
target_url?: string;
|
||||
cluster_match?: boolean; // Stage 3: Cluster match flag
|
||||
taxonomy_match?: boolean; // Stage 3: Taxonomy match flag
|
||||
relevance_score?: number; // Stage 3: Relevance score
|
||||
}
|
||||
|
||||
interface LinkResultsProps {
|
||||
@@ -39,17 +42,70 @@ export const LinkResults: React.FC<LinkResultsProps> = ({
|
||||
|
||||
<div className="border-t border-gray-200 dark:border-gray-700 pt-4">
|
||||
<h4 className="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Added Links:</h4>
|
||||
<ul className="space-y-2">
|
||||
{links.map((link, index) => (
|
||||
<li key={index} className="flex items-center gap-2 text-sm">
|
||||
<span className="text-gray-600 dark:text-gray-400">"{link.anchor_text}"</span>
|
||||
<span className="text-gray-400">→</span>
|
||||
<span className="text-blue-600 dark:text-blue-400">
|
||||
Content #{link.target_content_id}
|
||||
</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
{/* Stage 3: Group links by cluster match */}
|
||||
{links.some(l => l.cluster_match) && (
|
||||
<div className="mb-4">
|
||||
<div className="text-xs font-semibold text-blue-600 dark:text-blue-400 mb-2">
|
||||
Cluster Matches (High Priority)
|
||||
</div>
|
||||
<ul className="space-y-2">
|
||||
{links.filter(l => l.cluster_match).map((link, index) => (
|
||||
<li key={`cluster-${index}`} className="flex items-center gap-2 text-sm pl-2 border-l-2 border-blue-500">
|
||||
<span className="text-gray-600 dark:text-gray-400">"{link.anchor_text}"</span>
|
||||
<span className="text-gray-400">→</span>
|
||||
<span className="text-blue-600 dark:text-blue-400">
|
||||
Content #{link.target_content_id}
|
||||
</span>
|
||||
{link.relevance_score && (
|
||||
<span className="text-xs text-gray-500 dark:text-gray-400">
|
||||
(Score: {link.relevance_score})
|
||||
</span>
|
||||
)}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Other links */}
|
||||
{links.filter(l => !l.cluster_match || l.cluster_match === false).length > 0 && (
|
||||
<div>
|
||||
<div className="text-xs font-semibold text-gray-600 dark:text-gray-400 mb-2">
|
||||
Other Links
|
||||
</div>
|
||||
<ul className="space-y-2">
|
||||
{links.filter(l => !l.cluster_match || l.cluster_match === false).map((link, index) => (
|
||||
<li key={`other-${index}`} className="flex items-center gap-2 text-sm">
|
||||
<span className="text-gray-600 dark:text-gray-400">"{link.anchor_text}"</span>
|
||||
<span className="text-gray-400">→</span>
|
||||
<span className="text-blue-600 dark:text-blue-400">
|
||||
Content #{link.target_content_id}
|
||||
</span>
|
||||
{link.relevance_score && (
|
||||
<span className="text-xs text-gray-500 dark:text-gray-400">
|
||||
(Score: {link.relevance_score})
|
||||
</span>
|
||||
)}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Fallback if no grouping */}
|
||||
{!links.some(l => l.cluster_match !== undefined) && (
|
||||
<ul className="space-y-2">
|
||||
{links.map((link, index) => (
|
||||
<li key={index} className="flex items-center gap-2 text-sm">
|
||||
<span className="text-gray-600 dark:text-gray-400">"{link.anchor_text}"</span>
|
||||
<span className="text-gray-400">→</span>
|
||||
<span className="text-blue-600 dark:text-blue-400">
|
||||
Content #{link.target_content_id}
|
||||
</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user