feat: add apollo script and fix markdown hook error #771
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What has changed?
Fixed the markdow hook error that was causing build failures. Also added the apollo script.
Please include a summary of the change.
markdown.hooks.onBrokenMarkdownLinksblock fromdocusaurus.config.js. Docusaurus 3 doesn’t recognizemarkdown.hooks, so keeping it causedError: These field(s) ("markdown.hooks",) are not recognized in docusaurus.config.js. during config validation.docusaurus build/npm run buildtracker.iife.jswith a cache-busting query string and callswindow.trackingFunctions.onLoadwith the providedappId, so the third-party tracker boots without blocking the docs render.docusaurus.config.jsvia an object that mirrored the original<script>(IIFE + DOM operations) and even gave it an id so Docusaurus could manage it reliably.scripts[2]isn’t valid because the config expects either a plain string or an object with a src. InlineinnerHTMLobjects don’t pass validation anymore.apollo-init.js, which runs the same IIFE, generates the cache-buster, injects the tracker, and forwards the appId once onload fires.docusaurus.config.jsjust referencesapollo-init.jswith async/defer, so the build validates, the script stays non-blocking, and the tracker still initializes exactly as before.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please run npm run build and npm run serve to check if the changes are working as expected. Please include screenshots of the output of both the commands. Add screenshots/gif of the changes if possible.
npm run buildand nothing breaks:Checklist: