Loading...
Loading...
Inject Call-to-Action blocks into Astro site content with intelligent placement strategies. Use when the user wants to add CTAs, newsletter signups, product promotions, or any content blocks to blog posts. Supports multiple placement strategies (end, after 50%, after 60%), content scoring for relevance, and dry-run preview.
npx skill4agent add nicepkg/ai-workflow astro-cta-injector.astro.mdconfig.json{
"content_path": "./src/content/blog",
"file_patterns": ["*.astro", "*.md"],
"cta_types": {
"newsletter": {
"template": "newsletter.html",
"default_placement": "after-paragraph-50%",
"keywords": ["tip", "guide", "learn", "strategy"]
},
"product": {
"template": "product.html",
"default_placement": "end",
"keywords": ["productivity", "task", "habit", "goal"]
}
},
"output": {
"state_file": "./state/cta_injection_progress.json",
"backup_dir": "./backups",
"report_file": "./reports/cta_injection_report.md"
},
"dry_run": true
}| Strategy | Description | Best For |
|---|---|---|
| After all content | Non-intrusive CTAs |
| After 50% of paragraphs | Mid-content engagement |
| After 60% of paragraphs | Later engagement |
| After first H2 | Early engagement |
| Before last paragraph | Strong finish |
templates/<!-- templates/newsletter.html -->
<aside class="cta-newsletter" data-cta-type="newsletter">
<h3>{{title}}</h3>
<p>{{description}}</p>
<form action="{{form_url}}" method="post">
<input type="email" placeholder="Your email" required />
<button type="submit">Subscribe</button>
</form>
</aside>{{title}}{{description}}{{form_url}}{{product_url}}{{image_url}}python scripts/score_posts.py --content-path ./src/content/blog --cta-type newsletterpython scripts/preview_injection.py --input scored_posts.json --cta-type newsletterpython scripts/inject_ctas.py --input scored_posts.json --cta-type newsletter{
"posts": [
{
"file_path": "./src/content/blog/my-post.astro",
"title": "My Blog Post",
"relevance_score": 8.5,
"cta_type": "newsletter",
"placement": "after-paragraph-50%",
"cta_data": {
"title": "Get More Tips Like This",
"description": "Subscribe to my weekly newsletter"
}
}
]
}