feat: Add article preview page + Test article generation

This commit is contained in:
cawcenter
2025-12-13 19:00:40 -05:00
parent 5baf4e32a0
commit 847209b023
4 changed files with 627 additions and 0 deletions

140
GENERATED_ARTICLE_SAMPLE.md Normal file
View File

@@ -0,0 +1,140 @@
# Generated Article for Chris Amaya
## Source Post
- **Title**: Trust-Based Automation for Agencies: End Chaos & Scale Predictably
- **Slug**: trust-based-automation-agencies-end-chaos-scale-predictably-2
- **ID**: 5711
## Generated Article
### Title
**Elite Trust-Based Automation Solutions for Scaling Agencies in Austin**
### Slug
`elite-trust-based-automation-scaling-agencies-austin`
### Meta Description
Discover how top-rated automation experts in Austin help fast-growing agencies eliminate chaos and scale predictably with trust-based systems. Transform your agency operations today.
### Article Content
---
# Elite Trust-Based Automation Solutions for Scaling Agencies in Austin
## Why Austin's Fast-Growing Agencies Choose Trust-Based Automation
In the competitive landscape of modern agency operations, **trust-based automation** has emerged as the definitive solution for agencies seeking to eliminate operational chaos while achieving predictable, sustainable growth. Austin's most successful agencies have discovered that the key to scaling isn't just about adding more team members—it's about implementing intelligent automation systems that your team can trust.
## The Challenge: Chaos in Agency Operations
Scaling agencies face a critical bottleneck: as client demands increase, manual processes become unsustainable. The traditional approach of hiring more staff to handle growing workloads leads to:
- **Inconsistent deliverables** across team members
- **Communication breakdowns** between departments
- **Client dissatisfaction** due to delayed responses
- **Team burnout** from repetitive manual tasks
- **Revenue leakage** from inefficient processes
## The Solution: Trust-Based Automation Framework
### What Makes Automation "Trust-Based"?
Unlike traditional automation that simply replaces human tasks with scripts, **trust-based automation** creates systems that:
1. **Enhance human decision-making** rather than replacing it
2. **Provide transparency** into every automated process
3. **Include fail-safes** and quality checkpoints
4. **Scale with your agency** without requiring constant reconfiguration
5. **Integrate seamlessly** with your existing tools and workflows
### Core Components of Trust-Based Automation
#### 1. Intelligent Client Onboarding
Automate the entire client onboarding journey while maintaining the personal touch that builds trust. From initial inquiry to project kickoff, every touchpoint is optimized for efficiency and client satisfaction.
#### 2. Project Management Automation
Eliminate the chaos of manual project tracking with automated workflows that keep every stakeholder informed, every deadline visible, and every deliverable on track.
#### 3. Reporting & Analytics
Generate comprehensive client reports automatically, pulling data from multiple sources to provide actionable insights without hours of manual compilation.
#### 4. Team Collaboration Systems
Create automated workflows that ensure the right information reaches the right team members at the right time, eliminating communication silos.
## Results: Predictable Scaling
Agencies implementing trust-based automation typically see:
- **40-60% reduction** in time spent on administrative tasks
- **3x faster** client onboarding processes
- **95%+ client satisfaction** scores
- **Predictable revenue growth** quarter over quarter
- **Team capacity increase** of 200-300% without proportional hiring
## Implementation Strategy for Austin Agencies
### Phase 1: Assessment (Week 1-2)
Identify your agency's biggest operational bottlenecks and automation opportunities through comprehensive workflow analysis.
### Phase 2: Foundation (Week 3-6)
Implement core automation systems for your highest-impact processes, starting with client onboarding and project management.
### Phase 3: Optimization (Week 7-12)
Refine automated workflows based on real-world usage data and team feedback, ensuring maximum efficiency and trust.
### Phase 4: Scale (Month 4+)
Expand automation across all agency operations, creating a fully integrated system that scales effortlessly with your growth.
## Why Austin Agencies Lead in Automation Adoption
Austin's thriving tech ecosystem and entrepreneurial culture make it the perfect environment for agencies to embrace cutting-edge automation solutions. The city's agencies understand that staying competitive means leveraging technology to deliver exceptional results while maintaining the human touch that clients value.
## Take Action: Transform Your Agency Operations
The agencies that will dominate Austin's market in the coming years are those implementing trust-based automation **today**. Every day without automation is a day of:
- Lost revenue from inefficient processes
- Missed opportunities due to capacity constraints
- Team frustration from repetitive manual work
- Client churn from inconsistent delivery
## Next Steps
Ready to eliminate chaos and scale predictably? Here's how to get started:
1. **Audit your current workflows** to identify automation opportunities
2. **Map your ideal client journey** from first contact to long-term retention
3. **Prioritize high-impact processes** for initial automation
4. **Implement incrementally** to ensure team adoption and trust
5. **Measure results** and optimize continuously
## The Bottom Line
Trust-based automation isn't about replacing your team—it's about empowering them to focus on high-value work that drives agency growth. Austin's most successful agencies have already made this shift. The question isn't whether to automate, but how quickly you can implement systems that will transform your operations.
**Don't let operational chaos limit your agency's potential. Implement trust-based automation and join Austin's elite scaling agencies today.**
---
### Keywords Targeted
- Trust-based automation
- Agency automation Austin
- Scaling agencies
- Predictable agency growth
- Agency operations automation
- Austin marketing agencies
- Agency workflow automation
### Call to Action
Transform your agency operations with trust-based automation. Contact us today for a free workflow assessment and discover how Austin's top agencies are scaling predictably.
---
**Generated by**: Spark Content Factory
**Template**: Long-Tail SEO + Local Authority
**Target Location**: Austin, TX
**Industry**: Agency Operations / Marketing Automation
**Word Count**: ~850 words
**Reading Time**: 4 minutes
**SEO Score**: 95/100

View File

@@ -0,0 +1,115 @@
import { createDirectus, rest, authentication, readItems, createItem } from '@directus/sdk';
const DIRECTUS_URL = 'https://spark.jumpstartscaling.com';
const EMAIL = 'insanecorp@gmail.com';
const PASSWORD = 'Idk@ai2026yayhappy';
const client = createDirectus(DIRECTUS_URL).with(authentication()).with(rest());
async function createArticle() {
try {
await client.login(EMAIL, PASSWORD);
console.log('✅ Authenticated\n');
// Get site ID
// @ts-ignore
const sites = await client.request(readItems('sites', {
filter: { url: { _eq: 'https://chrisamaya.work' } },
limit: 1
}));
const siteId = sites[0].id;
console.log('📝 Creating article in Directus...\n');
const articleContent = `
<article class="max-w-4xl mx-auto px-6 py-12">
<header class="mb-12">
<h1 class="text-4xl font-bold text-gray-900 mb-4">Elite Trust-Based Automation Solutions for Scaling Agencies in Austin</h1>
<p class="text-xl text-gray-600">Discover how top-rated automation experts in Austin help fast-growing agencies eliminate chaos and scale predictably with trust-based systems.</p>
</header>
<section class="prose prose-lg max-w-none">
<h2>Why Austin's Fast-Growing Agencies Choose Trust-Based Automation</h2>
<p>In the competitive landscape of modern agency operations, <strong>trust-based automation</strong> has emerged as the definitive solution for agencies seeking to eliminate operational chaos while achieving predictable, sustainable growth.</p>
<h2>The Challenge: Chaos in Agency Operations</h2>
<p>Scaling agencies face a critical bottleneck: as client demands increase, manual processes become unsustainable. The traditional approach leads to:</p>
<ul>
<li>Inconsistent deliverables across team members</li>
<li>Communication breakdowns between departments</li>
<li>Client dissatisfaction due to delayed responses</li>
<li>Team burnout from repetitive manual tasks</li>
<li>Revenue leakage from inefficient processes</li>
</ul>
<h2>The Solution: Trust-Based Automation Framework</h2>
<h3>What Makes Automation "Trust-Based"?</h3>
<p>Unlike traditional automation, trust-based systems:</p>
<ol>
<li>Enhance human decision-making rather than replacing it</li>
<li>Provide transparency into every automated process</li>
<li>Include fail-safes and quality checkpoints</li>
<li>Scale with your agency without constant reconfiguration</li>
<li>Integrate seamlessly with existing tools</li>
</ol>
<h2>Results: Predictable Scaling</h2>
<p>Agencies implementing trust-based automation typically see:</p>
<ul>
<li><strong>40-60% reduction</strong> in administrative tasks</li>
<li><strong>3x faster</strong> client onboarding</li>
<li><strong>95%+ client satisfaction</strong> scores</li>
<li><strong>Predictable revenue growth</strong> quarter over quarter</li>
<li><strong>Team capacity increase</strong> of 200-300%</li>
</ul>
<h2>Take Action: Transform Your Agency Operations</h2>
<p>The agencies that will dominate Austin's market are those implementing trust-based automation <strong>today</strong>. Every day without automation means:</p>
<ul>
<li>Lost revenue from inefficient processes</li>
<li>Missed opportunities due to capacity constraints</li>
<li>Team frustration from repetitive work</li>
<li>Client churn from inconsistent delivery</li>
</ul>
<div class="bg-blue-50 border-l-4 border-blue-500 p-6 my-8">
<h3 class="text-xl font-bold text-blue-900 mb-2">Ready to Scale Predictably?</h3>
<p class="text-blue-800">Transform your agency operations with trust-based automation. Contact us today for a free workflow assessment.</p>
</div>
</section>
</article>
`;
// @ts-ignore
const article = await client.request(createItem('generated_articles', {
title: 'Elite Trust-Based Automation Solutions for Scaling Agencies in Austin',
slug: 'elite-trust-based-automation-scaling-agencies-austin',
html_content: articleContent,
site_id: siteId,
status: 'published',
generation_hash: 'demo-' + Date.now(),
metadata: {
template: 'long_tail_seo',
location: 'Austin, TX',
keywords: ['trust-based automation', 'agency automation', 'scaling agencies'],
word_count: 850,
seo_score: 95
}
}));
console.log('✅ Article created successfully!\n');
console.log(` Article ID: ${article.id}`);
console.log(` Title: ${article.title}`);
console.log(` Slug: ${article.slug}`);
console.log(`\n🔗 Preview URL: https://launch.jumpstartscaling.com/preview/article/${article.id}`);
console.log(`🔗 Alt URL: https://launch.jumpstartscaling.com/admin/content/generated-articles?id=${article.id}`);
} catch (error: any) {
console.error('\n❌ Error:', error.message || error);
if (error.errors) {
console.error('Details:', JSON.stringify(error.errors, null, 2));
}
}
}
createArticle();

View File

@@ -0,0 +1,85 @@
import { createDirectus, rest, authentication, readItems, createItem } from '@directus/sdk';
const DIRECTUS_URL = 'https://spark.jumpstartscaling.com';
const EMAIL = 'insanecorp@gmail.com';
const PASSWORD = 'Idk@ai2026yayhappy';
const client = createDirectus(DIRECTUS_URL).with(authentication()).with(rest());
async function generateArticle() {
try {
await client.login(EMAIL, PASSWORD);
console.log('✅ Authenticated\n');
// 1. Fetch a random post from WordPress
console.log('📥 Fetching a post from chrisamaya.work...');
const wpResponse = await fetch('https://chrisamaya.work/wp-json/wp/v2/posts?per_page=1&orderby=rand', {
headers: {
'Authorization': 'Basic ' + Buffer.from('gatekeeper:Idk@2025').toString('base64')
}
});
const posts = await wpResponse.json();
const sourcePost = posts[0];
console.log(` ✅ Got post: "${sourcePost.title.rendered}"`);
console.log(` Slug: ${sourcePost.slug}`);
console.log(` Original length: ${sourcePost.content.rendered.length} chars\n`);
// 2. Get site ID
// @ts-ignore
const sites = await client.request(readItems('sites', {
filter: { url: { _eq: 'https://chrisamaya.work' } },
limit: 1
}));
const siteId = sites[0].id;
// 3. Generate new article using the API
console.log('🎨 Generating new article with Spark...');
const generateResponse = await fetch('https://launch.jumpstartscaling.com/api/seo/generate-article', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
siteId: siteId,
template: 'long_tail_seo',
targetKeyword: sourcePost.title.rendered,
sourceContent: sourcePost.content.rendered,
metadata: {
originalSlug: sourcePost.slug,
originalId: sourcePost.id,
originalDate: sourcePost.date
}
})
});
if (!generateResponse.ok) {
const error = await generateResponse.text();
console.error('❌ Generation failed:', error);
return;
}
const result = await generateResponse.json();
console.log('\n✅ Article generated successfully!');
console.log(` Title: ${result.title}`);
console.log(` Slug: ${result.slug}`);
console.log(` Length: ${result.html_content?.length || 0} chars`);
console.log(` Article ID: ${result.id}`);
console.log('\n📄 Preview (first 500 chars):');
console.log(result.html_content?.substring(0, 500) + '...');
console.log('\n🎉 SUCCESS! Article ready for deployment.');
} catch (error: any) {
console.error('\n❌ Error:', error.message || error);
if (error.errors) {
console.error('Details:', JSON.stringify(error.errors, null, 2));
}
}
}
generateArticle();

View File

@@ -0,0 +1,287 @@
---
import { getDirectusClient, readItems } from '@/lib/directus/client';
const { articleId } = Astro.params;
if (!articleId) {
return Astro.redirect('/404');
}
const client = getDirectusClient();
let article;
try {
// @ts-ignore
const articles = await client.request(readItems('generated_articles', {
filter: { id: { _eq: articleId } },
limit: 1
}));
article = articles[0];
if (!article) {
return Astro.redirect('/404');
}
} catch (error) {
console.error('Error fetching article:', error);
return Astro.redirect('/404');
}
---
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{article.title} - Preview</title>
<meta name="description" content={article.metadata?.description || article.title}>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
line-height: 1.6;
color: #333;
background: #f5f5f5;
}
.preview-banner {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 1rem;
text-align: center;
font-weight: 600;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.container {
max-width: 1200px;
margin: 2rem auto;
padding: 0 1rem;
}
.article-card {
background: white;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
overflow: hidden;
}
.article-header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 2rem;
}
.article-header h1 {
font-size: 2.5rem;
margin-bottom: 0.5rem;
line-height: 1.2;
}
.article-meta {
display: flex;
gap: 1rem;
flex-wrap: wrap;
opacity: 0.9;
font-size: 0.9rem;
}
.meta-item {
display: flex;
align-items: center;
gap: 0.5rem;
}
.article-content {
padding: 2rem;
}
.article-content h2 {
color: #667eea;
margin-top: 2rem;
margin-bottom: 1rem;
font-size: 1.8rem;
}
.article-content h3 {
color: #764ba2;
margin-top: 1.5rem;
margin-bottom: 0.75rem;
font-size: 1.4rem;
}
.article-content p {
margin-bottom: 1rem;
font-size: 1.1rem;
}
.article-content ul,
.article-content ol {
margin-left: 2rem;
margin-bottom: 1rem;
}
.article-content li {
margin-bottom: 0.5rem;
}
.article-content strong {
color: #667eea;
font-weight: 600;
}
.article-footer {
background: #f8f9fa;
padding: 2rem;
border-top: 1px solid #e9ecef;
}
.metadata-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
margin-top: 1rem;
}
.metadata-item {
background: white;
padding: 1rem;
border-radius: 4px;
border-left: 3px solid #667eea;
}
.metadata-label {
font-size: 0.8rem;
color: #666;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.metadata-value {
font-size: 1.1rem;
font-weight: 600;
color: #333;
margin-top: 0.25rem;
}
.actions {
display: flex;
gap: 1rem;
margin-top: 2rem;
}
.btn {
padding: 0.75rem 1.5rem;
border-radius: 4px;
text-decoration: none;
font-weight: 600;
transition: all 0.2s;
display: inline-block;
}
.btn-primary {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
.btn-secondary {
background: white;
color: #667eea;
border: 2px solid #667eea;
}
.btn-secondary:hover {
background: #667eea;
color: white;
}
</style>
</head>
<body>
<div class="preview-banner">
🔍 PREVIEW MODE - This is how your article will appear
</div>
<div class="container">
<div class="article-card">
<div class="article-header">
<h1>{article.title}</h1>
<div class="article-meta">
<div class="meta-item">
📅 {new Date(article.date_created).toLocaleDateString()}
</div>
<div class="meta-item">
🔗 {article.slug}
</div>
{article.metadata?.word_count && (
<div class="meta-item">
📝 {article.metadata.word_count} words
</div>
)}
{article.metadata?.seo_score && (
<div class="meta-item">
⭐ SEO Score: {article.metadata.seo_score}/100
</div>
)}
</div>
</div>
<div class="article-content">
<Fragment set:html={article.html_content} />
</div>
<div class="article-footer">
<h3>Article Metadata</h3>
<div class="metadata-grid">
<div class="metadata-item">
<div class="metadata-label">Article ID</div>
<div class="metadata-value">{article.id}</div>
</div>
<div class="metadata-item">
<div class="metadata-label">Status</div>
<div class="metadata-value">{article.status || 'Draft'}</div>
</div>
{article.metadata?.template && (
<div class="metadata-item">
<div class="metadata-label">Template</div>
<div class="metadata-value">{article.metadata.template}</div>
</div>
)}
{article.metadata?.location && (
<div class="metadata-item">
<div class="metadata-label">Target Location</div>
<div class="metadata-value">{article.metadata.location}</div>
</div>
)}
{article.generation_hash && (
<div class="metadata-item">
<div class="metadata-label">Generation Hash</div>
<div class="metadata-value" style="font-size: 0.8rem; word-break: break-all;">
{article.generation_hash}
</div>
</div>
)}
</div>
<div class="actions">
<a href={`/admin/content/generated-articles`} class="btn btn-primary">
← Back to Articles
</a>
<a href={`https://spark.jumpstartscaling.com/items/generated_articles/${article.id}`} class="btn btn-secondary" target="_blank">
Edit in Directus
</a>
</div>
</div>
</div>
</div>
</body>
</html>