Jacky Zhao
2024-05-29 520acbbf6fe3ef43e9b2b662bfb21e0f9c3bb982
quartz/plugins/emitters/componentResources.ts
@@ -136,6 +136,14 @@
      posthog.init('${cfg.analytics.apiKey}',{api_host:'${cfg.analytics.host ?? "https://app.posthog.com"}'})\`
      document.head.appendChild(posthogScript)
    `)
  } else if (cfg.analytics?.provider === "tinylytics") {
    const siteId = cfg.analytics.siteId
    componentResources.afterDOMLoaded.push(`
      const tinylyticsScript = document.createElement("script")
      tinylyticsScript.src = "https://tinylytics.app/embed/${siteId}.js"
      tinylyticsScript.defer = true
      document.head.appendChild(tinylyticsScript)
    `)
  }
  if (cfg.enableSPA) {