From 984ab1c578e166922841ea3891fb4f8cbe87c4ad Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 18 Dec 2023 23:13:37 -0800 Subject: [PATCH] fix: change backtick to regular after making script loading less hacky --- quartz/components/renderPage.tsx | 2 +- quartz/plugins/emitters/componentResources.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/quartz/components/renderPage.tsx b/quartz/components/renderPage.tsx index 02db2b0..b3fe06b 100644 --- a/quartz/components/renderPage.tsx +++ b/quartz/components/renderPage.tsx @@ -23,7 +23,7 @@ export function pageResources( staticResources: StaticResources, ): StaticResources { const contentIndexPath = joinSegments(baseDir, "static/contentIndex.json") - const contentIndexScript = `const fetchData = fetch(\`${contentIndexPath}\`).then(data => data.json())` + const contentIndexScript = `const fetchData = fetch("${contentIndexPath}").then(data => data.json())` return { css: [joinSegments(baseDir, "index.css"), ...staticResources.css], diff --git a/quartz/plugins/emitters/componentResources.ts b/quartz/plugins/emitters/componentResources.ts index 116e4e3..884db4d 100644 --- a/quartz/plugins/emitters/componentResources.ts +++ b/quartz/plugins/emitters/componentResources.ts @@ -85,11 +85,11 @@ function addGlobalPageResources( componentResources.afterDOMLoaded.push(` window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } - gtag(\`js\`, new Date()); - gtag(\`config\`, \`${tagId}\`, { send_page_view: false }); + gtag("js", new Date()); + gtag("config", "${tagId}", { send_page_view: false }); - document.addEventListener(\`nav\`, () => { - gtag(\`event\`, \`page_view\`, { + document.addEventListener("nav", () => { + gtag("event", "page_view", { page_title: document.title, page_location: location.href, });