aeo.js 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +188 -6
- package/dist/astro.d.mts +9 -0
- package/dist/astro.d.ts +9 -0
- package/dist/astro.js +1179 -0
- package/dist/astro.js.map +1 -0
- package/dist/astro.mjs +1172 -0
- package/dist/astro.mjs.map +1 -0
- package/dist/index.d.mts +17 -0
- package/dist/index.d.ts +17 -1
- package/dist/index.js +876 -1
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +869 -1
- package/dist/index.mjs.map +1 -0
- package/dist/next.d.mts +33 -0
- package/dist/next.d.ts +33 -0
- package/dist/next.js +1113 -0
- package/dist/next.js.map +1 -0
- package/dist/next.mjs +1106 -0
- package/dist/next.mjs.map +1 -0
- package/dist/react.d.mts +10 -0
- package/dist/react.d.ts +10 -0
- package/dist/react.js +1023 -0
- package/dist/react.js.map +1 -0
- package/dist/react.mjs +1020 -0
- package/dist/react.mjs.map +1 -0
- package/dist/types-BTY-v-7i.d.mts +132 -0
- package/dist/types-BTY-v-7i.d.ts +132 -0
- package/dist/webpack.d.mts +11 -0
- package/dist/webpack.d.ts +11 -0
- package/dist/webpack.js +1019 -0
- package/dist/webpack.js.map +1 -0
- package/dist/webpack.mjs +1013 -0
- package/dist/webpack.mjs.map +1 -0
- package/dist/widget.d.mts +37 -0
- package/dist/widget.d.ts +37 -0
- package/dist/widget.js +1004 -0
- package/dist/widget.js.map +1 -0
- package/dist/widget.mjs +1001 -0
- package/dist/widget.mjs.map +1 -0
- package/package.json +64 -10
- package/dist/cli.js +0 -2
package/README.md
CHANGED
|
@@ -2,18 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
Answer Engine Optimization for the modern web. Make your site discoverable by AI crawlers and LLMs.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://github.com/multivmlabs/ralph-starter)
|
|
6
6
|
|
|
7
7
|
## What is AEO?
|
|
8
8
|
|
|
9
9
|
Answer Engine Optimization (AEO) is the practice of making your website discoverable and citable by AI-powered answer engines like ChatGPT, Claude, Perplexity, and SearchGPT.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
aeo.js auto-generates the files these engines look for and provides a drop-in widget that shows visitors how your site appears to AI.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- **`llms.txt` / `llms-full.txt`** -- LLM-readable summaries of your site
|
|
16
|
+
- **`robots.txt`** -- AI-crawler-aware robots directives
|
|
17
|
+
- **`sitemap.xml`** -- Standard sitemap generation
|
|
18
|
+
- **`docs.json`** -- Structured documentation manifest
|
|
19
|
+
- **`ai-index.json`** -- AI-optimized content index
|
|
20
|
+
- **Raw Markdown** -- Per-page `.md` files extracted from your HTML
|
|
21
|
+
- **Human/AI Widget** -- Drop-in toggle showing the AI-readable version of any page
|
|
22
|
+
|
|
23
|
+
## Supported Frameworks
|
|
24
|
+
|
|
25
|
+
| Framework | Status | Import |
|
|
26
|
+
|-----------|--------|--------|
|
|
27
|
+
| Next.js | Stable | `aeo.js/next` |
|
|
28
|
+
| Astro | Stable | `aeo.js/astro` |
|
|
29
|
+
| Webpack | Stable | `aeo.js/webpack` |
|
|
30
|
+
| Vite | Coming soon | -- |
|
|
31
|
+
| Nuxt | Coming soon | -- |
|
|
17
32
|
|
|
18
33
|
## Install
|
|
19
34
|
|
|
@@ -21,6 +36,173 @@ Answer Engine Optimization (AEO) is the practice of making your website discover
|
|
|
21
36
|
npm install aeo.js
|
|
22
37
|
```
|
|
23
38
|
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
### Next.js
|
|
42
|
+
|
|
43
|
+
Wrap your Next.js config with `withAeo`:
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
// next.config.mjs
|
|
47
|
+
import { withAeo } from 'aeo.js/next';
|
|
48
|
+
|
|
49
|
+
export default withAeo({
|
|
50
|
+
aeo: {
|
|
51
|
+
title: 'My Site',
|
|
52
|
+
description: 'A site optimized for AI discovery',
|
|
53
|
+
url: 'https://mysite.com',
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
After building, run the post-build step to extract content from pre-rendered pages:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"scripts": {
|
|
63
|
+
"postbuild": "node -e \"import('aeo.js/next').then(m => m.postBuild({ title: 'My Site', url: 'https://mysite.com' }))\""
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Astro
|
|
69
|
+
|
|
70
|
+
Add the integration in your Astro config:
|
|
71
|
+
|
|
72
|
+
```js
|
|
73
|
+
// astro.config.mjs
|
|
74
|
+
import { defineConfig } from 'astro/config';
|
|
75
|
+
import { aeoAstroIntegration } from 'aeo.js/astro';
|
|
76
|
+
|
|
77
|
+
export default defineConfig({
|
|
78
|
+
site: 'https://mysite.com',
|
|
79
|
+
integrations: [
|
|
80
|
+
aeoAstroIntegration({
|
|
81
|
+
title: 'My Site',
|
|
82
|
+
description: 'A site optimized for AI discovery',
|
|
83
|
+
url: 'https://mysite.com',
|
|
84
|
+
}),
|
|
85
|
+
],
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Webpack
|
|
90
|
+
|
|
91
|
+
Add the plugin to your webpack config:
|
|
92
|
+
|
|
93
|
+
```js
|
|
94
|
+
// webpack.config.js
|
|
95
|
+
const { AeoWebpackPlugin } = require('aeo.js/webpack');
|
|
96
|
+
|
|
97
|
+
module.exports = {
|
|
98
|
+
plugins: [
|
|
99
|
+
new AeoWebpackPlugin({
|
|
100
|
+
title: 'My Site',
|
|
101
|
+
description: 'A site optimized for AI discovery',
|
|
102
|
+
url: 'https://mysite.com',
|
|
103
|
+
}),
|
|
104
|
+
],
|
|
105
|
+
};
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Configuration
|
|
109
|
+
|
|
110
|
+
```js
|
|
111
|
+
import { defineConfig } from 'aeo.js';
|
|
112
|
+
|
|
113
|
+
export default defineConfig({
|
|
114
|
+
// Required
|
|
115
|
+
title: 'My Site',
|
|
116
|
+
url: 'https://mysite.com',
|
|
117
|
+
|
|
118
|
+
// Optional
|
|
119
|
+
description: 'A description of your site',
|
|
120
|
+
contentDir: 'docs', // Directory with handwritten .md files
|
|
121
|
+
outDir: 'public', // Output directory for generated files
|
|
122
|
+
|
|
123
|
+
// Toggle individual generators
|
|
124
|
+
generators: {
|
|
125
|
+
robotsTxt: true, // robots.txt
|
|
126
|
+
llmsTxt: true, // llms.txt
|
|
127
|
+
llmsFullTxt: true, // llms-full.txt
|
|
128
|
+
rawMarkdown: true, // Per-page .md files
|
|
129
|
+
manifest: true, // docs.json
|
|
130
|
+
sitemap: true, // sitemap.xml
|
|
131
|
+
aiIndex: true, // ai-index.json
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
// Customize robots.txt
|
|
135
|
+
robots: {
|
|
136
|
+
allow: ['/'],
|
|
137
|
+
disallow: ['/admin'],
|
|
138
|
+
crawlDelay: 0,
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
// Widget configuration
|
|
142
|
+
widget: {
|
|
143
|
+
enabled: true,
|
|
144
|
+
position: 'bottom-right', // 'bottom-left' | 'top-right' | 'top-left'
|
|
145
|
+
humanLabel: 'Human',
|
|
146
|
+
aiLabel: 'AI',
|
|
147
|
+
showBadge: true,
|
|
148
|
+
theme: {
|
|
149
|
+
background: 'rgba(18, 18, 24, 0.9)',
|
|
150
|
+
text: '#C0C0C5',
|
|
151
|
+
accent: '#E8E8EA',
|
|
152
|
+
badge: '#4ADE80',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Widget
|
|
159
|
+
|
|
160
|
+
The Human/AI widget is a floating toggle that lets visitors switch between the normal page and its AI-readable markdown version. It's automatically injected by the Astro integration. For Next.js, you can add it manually:
|
|
161
|
+
|
|
162
|
+
```tsx
|
|
163
|
+
// app/layout.tsx (or any client component)
|
|
164
|
+
'use client';
|
|
165
|
+
import { useEffect } from 'react';
|
|
166
|
+
|
|
167
|
+
export function AeoWidgetLoader() {
|
|
168
|
+
useEffect(() => {
|
|
169
|
+
import('aeo.js/widget').then(({ AeoWidget }) => {
|
|
170
|
+
new AeoWidget({
|
|
171
|
+
config: {
|
|
172
|
+
title: 'My Site',
|
|
173
|
+
url: 'https://mysite.com',
|
|
174
|
+
widget: { enabled: true, position: 'bottom-right' },
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
}, []);
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
When a visitor clicks **AI**, the widget:
|
|
184
|
+
1. Fetches the `.md` file for the current page
|
|
185
|
+
2. Falls back to extracting markdown from the live DOM if no `.md` exists
|
|
186
|
+
3. Displays the markdown with syntax highlighting
|
|
187
|
+
4. Offers copy-to-clipboard and download actions
|
|
188
|
+
|
|
189
|
+
## Generated Files
|
|
190
|
+
|
|
191
|
+
After building, your output directory will contain:
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
public/
|
|
195
|
+
robots.txt # AI-crawler-aware directives
|
|
196
|
+
llms.txt # Short LLM-readable summary
|
|
197
|
+
llms-full.txt # Full content for LLMs
|
|
198
|
+
sitemap.xml # Standard sitemap
|
|
199
|
+
docs.json # Documentation manifest
|
|
200
|
+
ai-index.json # AI-optimized content index
|
|
201
|
+
index.md # Markdown for /
|
|
202
|
+
about.md # Markdown for /about
|
|
203
|
+
... # One .md per discovered page
|
|
204
|
+
```
|
|
205
|
+
|
|
24
206
|
## License
|
|
25
207
|
|
|
26
208
|
MIT
|
package/dist/astro.d.mts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { A as AeoConfig } from './types-BTY-v-7i.mjs';
|
|
2
|
+
|
|
3
|
+
declare function aeoAstroIntegration(options?: AeoConfig): any;
|
|
4
|
+
declare const AeoMetaTags: ({ config }: {
|
|
5
|
+
config?: AeoConfig;
|
|
6
|
+
}) => string;
|
|
7
|
+
declare function defineAeoConfig(config: AeoConfig): AeoConfig;
|
|
8
|
+
|
|
9
|
+
export { AeoMetaTags, aeoAstroIntegration, aeoAstroIntegration as default, defineAeoConfig };
|
package/dist/astro.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { A as AeoConfig } from './types-BTY-v-7i.js';
|
|
2
|
+
|
|
3
|
+
declare function aeoAstroIntegration(options?: AeoConfig): any;
|
|
4
|
+
declare const AeoMetaTags: ({ config }: {
|
|
5
|
+
config?: AeoConfig;
|
|
6
|
+
}) => string;
|
|
7
|
+
declare function defineAeoConfig(config: AeoConfig): AeoConfig;
|
|
8
|
+
|
|
9
|
+
export { AeoMetaTags, aeoAstroIntegration, aeoAstroIntegration as default, defineAeoConfig };
|