chore: use generated options

This commit is contained in:
jinhojang6
2023-06-27 23:25:02 +09:00
parent 966c6b3636
commit 2f1919de34
5 changed files with 8 additions and 8 deletions
@@ -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
View File
@@ -0,0 +1 @@
declare module '@generated/docusaurus-fathom/default/options'
+1 -1
View File
@@ -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',
},
],
],