SuperAPI AI 工具集

astro-cta-injector

通用与其它

查看项目

更新于 10-15 21:12

技能介绍

用途:向 Astro 站点内容(.astro 或 .md 文件)注入 CTA 区块,适用于为博客文章添加 newsletter 订阅、产品推广或自定义内容块。

主要能力:支持多种 CTA 类型(newsletter、product、custom);提供智能放置策略,包括 end、after-paragraph-50%、after-paragraph-60%、after-heading、before-conclusion;基于关键词密度、内容长度、主题匹配和已有 CTA 检测进行相关性评分(0-10,默认阈值 5.0);支持批量处理与预览。

使用方式:需 Astro 站点、Python 3.10+ 和 BeautifulSoup4。在技能目录创建 config.json 配置 content_path、file_patterns、cta_types、output 和 dry_run。模板为 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。

安全特性:默认 dry-run 模式、修改前创建备份、重复检测、回滚能力、预览差异。

限制:资料未提供具体收费、价格、平台兼容性细节或效果保证;需自行准备模板和配置。