mirror of
https://github.com/wavetermdev/docusaurus-og.git
synced 2026-08-05 13:46:35 -07:00
chore: use generated options
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import { SITE_ID, SCRIPT_URL } from './options'
|
||||
import {
|
||||
SITE_ID,
|
||||
SCRIPT_URL,
|
||||
} from '@generated/docusaurus-fathom/default/options'
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
@@ -24,8 +27,6 @@ const { fathom } = window as any
|
||||
fathom('set', 'siteId', SITE_ID)
|
||||
fathom('trackPageview')
|
||||
|
||||
console.log('PLUGIN_SITE_ID', SITE_ID)
|
||||
|
||||
export function onRouteDidUpdate({ location, previousLocation }) {
|
||||
if (location.pathname !== previousLocation?.pathname) {
|
||||
fathom('trackPageview')
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
export const SITE_ID = ''
|
||||
export const SCRIPT_URL = ''
|
||||
+1
@@ -0,0 +1 @@
|
||||
declare module '@generated/docusaurus-fathom/default/options'
|
||||
|
||||
@@ -13,7 +13,7 @@ export default function fathomPlugin(
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join(dir, 'options.ts'),
|
||||
`export const SITE_ID = '${siteId}'\nexport const SCRIPT_URL = '${scriptUrl}'`,
|
||||
`export const SITE_ID = "${siteId}"\nexport const SCRIPT_URL = "${scriptUrl}"`,
|
||||
)
|
||||
|
||||
return {
|
||||
|
||||
@@ -74,8 +74,8 @@ const config = {
|
||||
[
|
||||
'@acid-info/docusaurus-fathom',
|
||||
{
|
||||
siteId: 'SIDE_ID_2',
|
||||
scriptUrl: 'SCRIPT_URL_2',
|
||||
siteId: 'FUTMI',
|
||||
scriptUrl: '//fathom.status.im/tracker.js',
|
||||
},
|
||||
],
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user