Feature: Complete Admin UI Overhaul, Content Factory Showcase Mode, and Site Management

This commit is contained in:
cawcenter
2025-12-12 18:25:31 -05:00
parent 7a9b7ec86e
commit d8db5f42cf
59 changed files with 6277 additions and 186 deletions

View File

@@ -0,0 +1,44 @@
/**
* Publisher Service
* Handles syncing generated content to external sites (WordPress, Webflow, etc.).
*/
export class PublisherService {
/**
* Sync a specific article to its designated site.
* @param article The article object from Directus
* @param site The site configuration object
*/
async syncArticle(article: any, site: any) {
console.log(`[Publisher] Starting sync for Article ${article.id} to Site ${site.name}`);
try {
if (site.site_type === 'wordpress') {
await this.publishToWordPress(article, site);
} else if (site.site_type === 'webflow') {
await this.publishToWebflow(article, site);
} else {
console.log(`[Publisher] Unknown site type: ${site.site_type}`);
}
} catch (error) {
console.error(`[Publisher] Sync Failed:`, error);
throw error;
}
}
private async publishToWordPress(article: any, site: any) {
// Placeholder for WP REST API call
// const wp = new WPAPI({ endpoint: site.url, username: ..., password: ... });
// await wp.posts().create({ ... });
console.log(`[Publisher] 🚀 Simulating POST to WordPress at ${site.url}/wp-json/wp/v2/posts`);
console.log(`Title: ${article.title}`);
return true;
}
private async publishToWebflow(article: any, site: any) {
// Placeholder for Webflow API
console.log(`[Publisher] 🚀 Simulating POST to Webflow Collection`);
return true;
}
}