@stackql/docusaurus-plugin-aeo 0.1.1 → 0.1.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/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/index.js +21 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
Fix: cross-plugin loaded content was not captured because contentLoaded does not receive allContent in Docusaurus 3.x. Use allContentLoaded hook. Without this fix, feature 1 (.md companions) emitted zero files and feature 2 (llms.txt / llms-full.txt) was empty.
|
|
6
|
+
|
|
3
7
|
## 0.1.1
|
|
4
8
|
|
|
5
9
|
Bugfix release. v0.1.0 failed to build on a real Docusaurus 3.10 consumer with three distinct crashes; all three are fixed here.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackql/docusaurus-plugin-aeo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "AEO (Answer Engine Optimization) helpers for Docusaurus: .md companion files, llms.txt / llms-full.txt, an Ask AI dropdown, and /ai/* route conventions.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"exports": {
|
package/src/index.js
CHANGED
|
@@ -119,9 +119,27 @@ module.exports = function pluginAeo(context, rawOptions) {
|
|
|
119
119
|
const plugin = {
|
|
120
120
|
name: '@stackql/docusaurus-plugin-aeo',
|
|
121
121
|
|
|
122
|
-
// Surface the askAi config to theme components
|
|
123
|
-
//
|
|
124
|
-
|
|
122
|
+
// Surface the askAi config to theme components. setGlobalData MUST be
|
|
123
|
+
// called from contentLoaded - Docusaurus does not accept it from
|
|
124
|
+
// allContentLoaded, and theme components read it via
|
|
125
|
+
// usePluginData('@stackql/docusaurus-plugin-aeo') at render time.
|
|
126
|
+
async contentLoaded({ actions }) {
|
|
127
|
+
await actions.setGlobalData({
|
|
128
|
+
askAi: {
|
|
129
|
+
enabled: options.askAi.enabled,
|
|
130
|
+
providerOrder: options.askAi.providerOrder,
|
|
131
|
+
promptTemplate: options.askAi.promptTemplate,
|
|
132
|
+
placement: options.askAi.placement,
|
|
133
|
+
companionsEnabled: options.companions.enabled,
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
// Cross-plugin loaded content (docs, blog, pages) is only delivered to
|
|
139
|
+
// allContentLoaded in Docusaurus 3.x. contentLoaded receives only the
|
|
140
|
+
// current plugin's own content, so feature 1 needs this hook to see
|
|
141
|
+
// the docs/blog source files it has to mirror.
|
|
142
|
+
async allContentLoaded({ allContent }) {
|
|
125
143
|
if (allContent) {
|
|
126
144
|
for (const [pluginName, byId] of Object.entries(allContent)) {
|
|
127
145
|
if (!byId) continue;
|
|
@@ -135,16 +153,6 @@ module.exports = function pluginAeo(context, rawOptions) {
|
|
|
135
153
|
}
|
|
136
154
|
}
|
|
137
155
|
|
|
138
|
-
await actions.setGlobalData({
|
|
139
|
-
askAi: {
|
|
140
|
-
enabled: options.askAi.enabled,
|
|
141
|
-
providerOrder: options.askAi.providerOrder,
|
|
142
|
-
promptTemplate: options.askAi.promptTemplate,
|
|
143
|
-
placement: options.askAi.placement,
|
|
144
|
-
companionsEnabled: options.companions.enabled,
|
|
145
|
-
},
|
|
146
|
-
});
|
|
147
|
-
|
|
148
156
|
if (options.aiRoutes.validate) {
|
|
149
157
|
validateAiRoutes({
|
|
150
158
|
loadedContentByPlugin,
|