mirror of
https://github.com/wavetermdev/docusaurus-og.git
synced 2026-08-05 13:46:35 -07:00
feat: add disable prop to docusaurus-fathom
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
export type PluginOptions = {
|
||||
siteId: string
|
||||
scriptUrl: string
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@ export default function fathomPlugin(
|
||||
context: LoadContext,
|
||||
options: PluginOptions,
|
||||
): Plugin<undefined> {
|
||||
const { siteId, scriptUrl } = options
|
||||
const { siteId, scriptUrl, disabled = false } = options
|
||||
|
||||
const dir = path.join(context.generatedFilesDir, 'docusaurus-fathom/default')
|
||||
fs.ensureDirSync(dir)
|
||||
|
||||
@@ -18,7 +19,8 @@ export default function fathomPlugin(
|
||||
|
||||
return {
|
||||
name: 'docusaurus-fathom',
|
||||
getClientModules: () => [path.resolve(__dirname, './client/index.js')],
|
||||
getClientModules: () =>
|
||||
disabled ? [] : [path.resolve(__dirname, './client/index.js')],
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,14 @@ const config = {
|
||||
authorsMapPath: 'authors.yml',
|
||||
}),
|
||||
],
|
||||
[
|
||||
'@acid-info/docusaurus-fathom',
|
||||
{
|
||||
siteId: 'TEST',
|
||||
scriptUrl: 'https://fathom.status.im/tracker.js',
|
||||
disabled: true,
|
||||
},
|
||||
],
|
||||
],
|
||||
|
||||
themeConfig:
|
||||
|
||||
Reference in New Issue
Block a user