Skip to main content

Overview

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.

Post Lifecycle

Draft

Initial creation and editing phase. Posts can be saved and edited multiple times.

Pending Review

Submitted for editorial review. Awaits approval from editors or administrators.

Published

Live on the platform. Visible to all readers and indexed for search.

Rejected

Not approved for publication. Can be revised and resubmitted.

Post Status Management

The platform tracks posts through multiple states using the estados (status) system:
type PostStatus = 'draft' | 'pending' | 'published' | 'rejected';

interface Post {
  id: number;
  title: string;
  slug: string;
  content: string;          // MDX content
  excerpt: string;
  status: PostStatus;
  estadoId: number;         // Backend status ID (1-5)
  authorId: number;
  featuredImage: string;
  publishedAt?: string;
  createdAt: string;
  updatedAt: string;
}

Status Mapping

Status IDStatus NameDescription
1Borrador (Draft)Work in progress, not submitted
2En Revisión (Pending)Submitted for editorial approval
3Publicado (Published)Live and publicly accessible
4Rechazado (Rejected)Not approved for publication
5Archivado (Archived)Removed from active publication

Creating Posts

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).

MDX Editor Features

The platform uses an MDX editor that supports:
  • Rich text formatting: Headers, bold, italic, lists, blockquotes
  • Code blocks: Syntax highlighting for multiple languages
  • Embedded components: Cards, tabs, callouts, and custom React components
  • Media embedding: Images, videos, and interactive content
  • Auto-save: Automatic draft saving at configurable intervals
  • Version history: Track changes and revert to previous versions

Editor Configuration

interface EditorConfig {
  mode: 'markdown' | 'wysiwyg' | 'hybrid';
  autoSave: boolean;
  autoSaveInterval: number;     // milliseconds
  spellCheck: boolean;
  wordCount: boolean;
  readabilityScore: boolean;
}

Updating Posts

Edit existing posts with partial updates:
import { updatePost } from '@/services/postsService';

const updated = await updatePost(postId, {
  title: 'Updated Title',
  content: 'New content...',
  excerpt: 'New excerpt',
  tags: ['new', 'tags']
});

Status Updates

Change post status independently:
import { updatePostStatus } from '@/services/postsService';

// Submit for review
await updatePostStatus(postId, 'pending');

// Publish post
await updatePostStatus(postId, 'published');

// Reject post
await updatePostStatus(postId, 'rejected');
Status changes may require specific permissions. Writers can submit posts for review, but only Editors and Administrators can publish or reject posts.

Bulk Operations

Perform actions on multiple posts simultaneously:
import { bulkAction } from '@/services/postsService';

// Publish multiple posts
await bulkAction([1, 2, 3, 4], 'publish');

// Move to draft
await bulkAction([5, 6, 7], 'draft');

// Delete multiple posts
await bulkAction([8, 9], 'delete');
Upload featured images directly to posts:
import { uploadPostFeaturedImage } from '@/services/postsService';

const file = document.querySelector('input[type="file"]').files[0];
const { featuredImageUrl } = await uploadPostFeaturedImage(postId, file);

console.log('Image uploaded:', featuredImageUrl);

SEO Optimization

Each post includes comprehensive SEO settings:
interface PostSEO {
  metaTitle: string;           // Custom page title
  metaDescription: string;     // Meta description for search
  focusKeyword: string;        // Primary keyword
  readabilityScore?: number;   // Content readability (0-100)
}

// Update SEO fields
await updatePost(postId, {
  seo: {
    metaTitle: 'Best Practices for Content Marketing | Blog',
    metaDescription: 'Discover proven content marketing strategies...',
    focusKeyword: 'content marketing',
    readabilityScore: 78
  }
});

Content Organization

Categories

Assign multiple categories to posts:
import { addCategoriasToPost } from '@/services/postsService';

// Add categories to post
await addCategoriasToPost(postId, [1, 3, 5]);

Keywords (Tags)

Add existing or create new keywords:
import { 
  addKeywordsToPost,
  createAndAddKeywords,
  getPostKeywords 
} from '@/services/postsService';

// Add existing keywords by ID
await addKeywordsToPost(postId, [10, 15, 20]);

// Create and add new keywords
await createAndAddKeywords(postId, [
  'content strategy',
  'digital marketing',
  'SEO tips'
]);

// Get all keywords for a post
const keywords = await getPostKeywords(postId);

Advanced Queries

Retrieve posts sorted by view count:
import { getPostsPopulares } from '@/services/postsService';

const topPosts = await getPostsPopulares(10); // Top 10 posts
Get posts with recent high engagement:
import { getPostsTrending } from '@/services/postsService';

const trending = await getPostsTrending(5);

Posts Without Comments

Find posts that need engagement:
import { getPostsSinComentarios } from '@/services/postsService';

const noComments = await getPostsSinComentarios();

Old Drafts

Identify abandoned drafts:
import { getBorradoresAntiguos } from '@/services/postsService';

const oldDrafts = await getBorradoresAntiguos();

Engagement Tracking

View Tracking

Increment view count when users access posts:
import { incrementarVista } from '@/services/postsService';

// Track view with optional user ID and IP
await incrementarVista(postId, userId, ipAddress);

Like System

Manage post likes:
import { darLike, quitarLike } from '@/services/postsService';

// User likes a post
await darLike(postId, userId);

// User removes like
await quitarLike(postId, userId);

Editorial Workflow

Posts can include editorial metadata:
interface PostEditorial {
  reviewerId?: number;      // Editor who reviewed
  reviewedAt?: string;      // Review timestamp
  reviewNotes?: string;     // Editorial feedback
  approvedBy?: number;      // Final approver
  submittedAt?: string;     // Submission timestamp
  status?: string;          // Editorial status
}

Analytics Integration

Track post performance metrics:
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)
}

Author Performance

Get best-performing posts by author:
import { getMejorRendimientoPorAutor } from '@/services/postsService';

const topPosts = await getMejorRendimientoPorAutor(authorId, 5);

Best Practices

Content Quality

  • Write clear, engaging headlines
  • Use proper heading hierarchy
  • Include relevant images and media
  • Optimize for readability (aim for 60+ score)

SEO Optimization

  • Use focus keywords naturally
  • Write compelling meta descriptions
  • Create descriptive slugs
  • Add alt text to images

Editorial Process

  • Save drafts frequently
  • Submit for review when complete
  • Address reviewer feedback promptly
  • Update posts based on performance

Engagement

  • Respond to comments
  • Share posts on social media
  • Update content regularly
  • Cross-link related posts

Build docs developers (and LLMs) love