calevans/answer-engine-optimization
Composer 安装命令:
composer require calevans/answer-engine-optimization
包简介
StaticForge Feature: AnswerEngineOptimization
README 文档
README
A StaticForge feature package that optimises your site for AI-powered answer engines (LLMs, RAG pipelines, AI search). It handles structured data injection, llms.txt generation, AI-bot robots.txt rules, and data-driven FAQ schema — all automatically as part of the StaticForge build pipeline.
Installation
composer require calevans/AnswerEngineOptimization
Features
| Feature | Description |
|---|---|
AI-bot robots.txt |
Adds Allow: / rules for OAI-SearchBot, ChatGPT-User, Google-Extended, Anthropic-ai, and Claude-Web |
| Article JSON-LD | Injects Article structured data into every page <head> |
| BreadcrumbList JSON-LD | Injects BreadcrumbList structured data on all non-home pages |
| FAQ JSON-LD | Injects FAQPage structured data from frontmatter, [faq] shortcodes, or a shared JSON data file |
llms.txt |
Generates a site-wide llms.txt index for AI crawlers, with a titled header and per-page descriptions |
llms link tag |
Injects <link rel="llms" href="/llms.txt"> into every page <head> |
.md copy |
Publishes a stripped Markdown copy of each page alongside its HTML output |
Configuration
siteconfig.yaml
All keys are optional. The package works with sensible defaults when they are absent.
site: name: "My Site" # Becomes the `# Title` in llms.txt and the Article schema publisher name. # Defaults to "LLMs Documentation" in llms.txt when not set. tagline: "My tagline" # Becomes the `> description` blockquote in llms.txt. # Falls back to `site.description` if `tagline` is absent. description: "..." # Fallback description for llms.txt when `site.tagline` is not set. social: default_image: "https://example.com/logo.png" # Added as `publisher.logo` in the Article JSON-LD schema. answer_engine_optimization: faq_data_file: content/assets/faq.json # Path (relative to project root) to the shared FAQ JSON data file. # Defaults to `content/assets/faq.json` when not set.
Per-page frontmatter
--- title: "Page Title" description: "Shown as the description in the llms.txt entry for this page." no_llms: true # Set to true to exclude this page from llms.txt and suppress the <link rel="llms"> tag. aeo: key_takeaways: "A custom summary written by the author, used verbatim in llms.txt." faqs: - question: "What is this page about?" answer: "It is about answer engine optimisation." ---
FAQ data file
When answer_engine_optimization.faq_data_file is configured (or the default content/assets/faq.json exists), the package loads a shared bank of FAQs that can be referenced from any page via data-faq HTML attributes.
content/assets/faq.json
[
{"id": "what-is-aeo", "question": "What is answer engine optimisation?", "answer": "It is the practice of structuring content so AI systems can accurately surface it in answers."},
{"id": "pricing", "question": "How much does it cost?", "answer": "It is free and open source."}
]
Reference an entry in your Markdown by adding a data-faq attribute to any HTML element:
<div data-faq="what-is-aeo"></div> <div data-faq="pricing"></div>
The matching entries are automatically included in the FAQPage JSON-LD schema for that page.
Priority order for FAQ sources
FAQs from all three sources are merged in this order:
aeo.faqsin page frontmatter[faq question="…" answer="…"]shortcodes in page contentdata-faq="id"references resolved from the shared JSON data file
Priority order for llms.txt summary
The per-page summary line in llms.txt is resolved in this order:
aeo.key_takeawaysin page frontmatter (author-written, highest priority)descriptionin page frontmatter- Empty string (the colon is still emitted; the AI crawler can infer context from the
.mdcopy)
calevans/answer-engine-optimization 适用场景与选型建议
calevans/answer-engine-optimization 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 calevans/answer-engine-optimization 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 calevans/answer-engine-optimization 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 27
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-15