用途:向 Astro 站点的 .astro 或 .md 内容中注入 CTA 区块,例如博客文章里的 newsletter 订阅、产品推广或自定义内容块,并支持批量处理。
主要能力:支持多种 CTA 类型(newsletter、product、custom);提供多种放置策略,包括 end(全部内容之后)、after-paragraph-50%(50% 段落之后)、after-paragraph-60%、after-heading(首个 H2 之后)、before-conclusion(最后一段之前);按关键词密度、内容长度、主题匹配及是否已有 CTA 对文章进行 0-10 相关性评分,默认阈值 5.0;支持预览与批量注入。
使用方式:需 Astro 站点内容、Python 3.10+ 及 BeautifulSoup4。在技能目录创建 config.json,配置 content_path、file_patterns、cta_types、output 与 dry_run。CTA 模板为 templates/ 下的 HTML 文件,可用 {{title}}、{{description}}、{{form_url}}、{{product_url}}、{{image_url}} 变量。工作流分三步:python scripts/score_posts.py --content-path ./src/content/blog --cta-type newsletter;python scripts/preview_injection.py --input scored_posts.json --cta-type newsletter;python scripts/inject_ctas.py --input scored_posts.json --cta-type newsletter。输入为包含 posts 数组的 JSON,每项含 file_path、title、relevance_score、cta_type、placement、cta_data。
安全特性:默认 dry-run、修改前备份、重复检测、可从备份回滚、预览差异。
限制:资料未提供具体收费、价格、平台支持范围或效果数据;需自行准备模板与配置,且依赖 Python 环境。