From 35041564458eb15da49bd228ae0214ea4f0e13f8 Mon Sep 17 00:00:00 2001 From: Frederico Maia Date: Thu, 19 Sep 2024 15:12:53 -0300 Subject: [PATCH] Remove Kapa.ai from the v2 docs and add a legacy warning. --- docs/scripts/kapa.js | 18 ----------------- docs/scripts/legacy-warning.js | 35 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 18 deletions(-) delete mode 100644 docs/scripts/kapa.js create mode 100644 docs/scripts/legacy-warning.js diff --git a/docs/scripts/kapa.js b/docs/scripts/kapa.js deleted file mode 100644 index 9c9e5c8d5a3..00000000000 --- a/docs/scripts/kapa.js +++ /dev/null @@ -1,18 +0,0 @@ -hexo.extend.filter.register('after_render:html', function(html) { - const scriptTag = ` - -`.trim(); - - if (html.indexOf('') !== -1) { - return html.replace('', scriptTag + ''); - } - - return html; -}); \ No newline at end of file diff --git a/docs/scripts/legacy-warning.js b/docs/scripts/legacy-warning.js new file mode 100644 index 00000000000..3c54aadb333 --- /dev/null +++ b/docs/scripts/legacy-warning.js @@ -0,0 +1,35 @@ +/* global hexo */ + +hexo.extend.filter.register('after_render:html', function (str) { + const warningMessage = ` +
+

+ ⚠️ You're browsing the documentation for an old version of Meteor.js. + Check out the v3 docs and migration guide. +

+
+ `; + + const css = ` + + `; + + const injectedContent = css + warningMessage; + + return str.replace(/
/, `
${injectedContent}`); +}); \ No newline at end of file