docs: added tracking
This commit is contained in:
parent
4a027d5498
commit
1b6e41a709
2 changed files with 27 additions and 0 deletions
|
@ -17,5 +17,6 @@ module.exports = {
|
||||||
externalPattern: ['**/dist/**'],
|
externalPattern: ['**/dist/**'],
|
||||||
plugin: [
|
plugin: [
|
||||||
'./plugin-external-links.cjs',
|
'./plugin-external-links.cjs',
|
||||||
|
'./plugin-umami.cjs',
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
26
.config/typedoc/plugin-umami.cjs
Normal file
26
.config/typedoc/plugin-umami.cjs
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
const { JSX } = require('typedoc')
|
||||||
|
|
||||||
|
const WEBSITE_ID = '4aac3220-0450-44d6-9d0c-8fe7fe8e62bd'
|
||||||
|
const UMAMI_URL = 'https://zond.tei.su'
|
||||||
|
const UMAMI_NOSCRIPT = `https://tei.su/zond.php?website=${WEBSITE_ID}`
|
||||||
|
|
||||||
|
const { createElement: h } = JSX
|
||||||
|
|
||||||
|
function load(app) {
|
||||||
|
app.renderer.hooks.on('head.end', (event) => {
|
||||||
|
return h('script', {
|
||||||
|
async: true,
|
||||||
|
src: `${UMAMI_URL}/script.js`,
|
||||||
|
'data-website-id': WEBSITE_ID,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
app.renderer.hooks.on('body.begin', (event) => {
|
||||||
|
return h(
|
||||||
|
'noscript',
|
||||||
|
null,
|
||||||
|
h('div', null, h('img', { src: UMAMI_NOSCRIPT, style: 'position:absolute; left:-9999px;' })),
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = { load }
|
Loading…
Reference in a new issue