diff --git a/docusaurus.config.js b/docusaurus.config.js index b9fceb3f83c..877ff0d625f 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -367,6 +367,30 @@ module.exports = { versions: VERSIONS_JSON, }, ], + function (context, options) { + return { + name: 'beamer', + injectHtmlTags({ content }) { + // Only inject Beamer when deployed to production, so we don't use up Beamer "users" + if (process.env.NODE_ENV === 'production') { + return { + // For performance, Beamer recommends injecting these scripts at the very bottom of the + // Thus, custom plugin is required here to use postBodyTags + postBodyTags: [ + ``, + { + tagName: 'script', + attributes: { + src: 'https://app.getbeamer.com/js/beamer-embed.js', + defer: 'defer', + }, + }, + ], + }; + } + }, + }; + }, ], customFields: {}, themes: [],