chore: add clarity script (#48993)

* chore: add clarity script

* chore: add clarity script
This commit is contained in:
afc163 2024-05-21 20:46:04 +08:00 committed by GitHub
parent 9b916f6f32
commit c1566bead4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 1 deletions

14
.dumi/scripts/clarity.js Normal file
View File

@ -0,0 +1,14 @@
/* eslint-disable */
// https://clarity.microsoft.com
(function (c, l, a, r, i, t, y) {
c[a] =
c[a] ||
function () {
(c[a].q = c[a].q || []).push(arguments);
};
t = l.createElement(r);
t.async = 1;
t.src = 'https://www.clarity.ms/tag/' + i;
y = l.getElementsByTagName(r)[0];
y.parentNode.insertBefore(t, y);
})(window, document, 'clarity', 'script', 'lyia7jfwui');

View File

@ -171,7 +171,13 @@ export default defineConfig({
scripts: [
{
async: true,
content: fs.readFileSync(path.join(__dirname, '.dumi', 'mirror-modal.js')).toString(),
content: fs
.readFileSync(path.join(__dirname, '.dumi', 'scripts', 'mirror-modal.js'))
.toString(),
},
{
async: true,
content: fs.readFileSync(path.join(__dirname, '.dumi', 'scripts', 'clarity.js')).toString(),
},
],
});