The Blog Marketing Platform provides a comprehensive post management system that supports the complete content lifecycle—from draft creation to publishing and archiving. With an MDX-powered editor, advanced SEO tools, and flexible categorization, content creators can efficiently manage their blog content.
The createPost() function handles post creation with automatic field transformation:
import { createPost } from '@/services/postsService';const newPost = await createPost({ title: 'Getting Started with Content Marketing', content: '## Introduction\n\nContent marketing is...', // MDX format excerpt: 'Learn the fundamentals of content marketing', status: 'draft', authorId: userId, categoryId: 3, tags: ['marketing', 'content', 'strategy'], featuredImage: 'https://example.com/image.jpg', seo: { metaTitle: 'Content Marketing Guide', metaDescription: 'Complete guide to content marketing', focusKeyword: 'content marketing' }});
The system automatically generates URL-friendly slugs from post titles and calculates estimated reading time based on content length (200 words per minute).
import { addKeywordsToPost, createAndAddKeywords, getPostKeywords} from '@/services/postsService';// Add existing keywords by IDawait addKeywordsToPost(postId, [10, 15, 20]);// Create and add new keywordsawait createAndAddKeywords(postId, [ 'content strategy', 'digital marketing', 'SEO tips']);// Get all keywords for a postconst keywords = await getPostKeywords(postId);
import { incrementarVista } from '@/services/postsService';// Track view with optional user ID and IPawait incrementarVista(postId, userId, ipAddress);
import { darLike, quitarLike } from '@/services/postsService';// User likes a postawait darLike(postId, userId);// User removes likeawait quitarLike(postId, userId);
interface Post { views: number; // Total page views likes: number; // Total likes received comments: number; // Total comments shares: number; // Social shares readTime: number; // Estimated reading time (minutes)}