Overview
TheBlogPost interface defines the structure for blog articles throughout the VENCOL application. It supports both static blog data and WordPress API integration, providing all necessary fields for displaying blog content, excerpts, and metadata.
Type Definition
source/types.ts:8-17
Properties
number
required
Unique identifier for the blog post. Used for keys in React lists and database references.
string
required
The main headline of the blog post. Displayed in listings and on the detail page.
string
required
URL-friendly identifier used for routing (e.g.,
"que-es-la-mioglobina" becomes /blog/que-es-la-mioglobina).string
required
Short summary or preview text of the blog post. Typically displayed in blog listing cards.
string
required
The full HTML content of the blog post. Can contain rich text, images, and formatting.
string
required
Publication date in human-readable format (e.g.,
"Oct 24, 2023" or "24 oct. 2023").string
required
URL to the featured image for the blog post. Used as thumbnail in listings and hero image in detail view.
string
required
Category or tag for content organization (e.g.,
"Educativo", "Tecnología", "Medio Ambiente").Usage Examples
Static Blog Posts
Defining blog posts directly in the application data:source/data/data.tsx:410-461
WordPress API Integration
Mapping WordPress API responses to theBlogPost interface:
source/lib/wordpress.ts:33-80
Rendering Blog Cards
UsingBlogPost data in components:
Related Types
- WPPage - Similar structure for static pages from WordPress
- Service - Another content type with similar fields for solutions
Validation Notes
Date Formatting
Thedate field is stored as a formatted string rather than a Date object:
source/lib/wordpress.ts:24-31
SEO Considerations
- The
slugshould be URL-safe and descriptive for SEO - The
excerptis ideal for meta descriptions - The
imageURL should be optimized and include alt text in implementation - The
titlebecomes the page title in detail views