From 921f45cf7001a6af77cd0bf10f7fbf154eebabff Mon Sep 17 00:00:00 2001
From: threehymns <70611435+threehymns@users.noreply.github.com>
Date: Wed, 25 Sep 2024 00:20:36 +0000
Subject: [PATCH] feat: add a config option for a pageTitleSuffix (#1320)
---
quartz/plugins/emitters/componentResources.ts | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/quartz/plugins/emitters/componentResources.ts b/quartz/plugins/emitters/componentResources.ts
index 81d3af2..d36b51c 100644
--- a/quartz/plugins/emitters/componentResources.ts
+++ b/quartz/plugins/emitters/componentResources.ts
@@ -136,6 +136,22 @@
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)
+ `)
+ } else if (cfg.analytics?.provider === "cabin") {
+ componentResources.afterDOMLoaded.push(`
+ const cabinScript = document.createElement("script")
+ cabinScript.src = "${cfg.analytics.host ?? "https://scripts.withcabin.com"}/hello.js"
+ cabinScript.defer = true
+ cabinScript.async = true
+ document.head.appendChild(cabinScript)
+ `)
}
if (cfg.enableSPA) {
--
Gitblit v1.10.0