Jacky Zhao
2023-12-19 984ab1c578e166922841ea3891fb4f8cbe87c4ad
fix: change backtick to regular after making script loading less hacky
2 files modified
10 ■■■■ changed files
quartz/components/renderPage.tsx 2 ●●● patch | view | raw | blame | history
quartz/plugins/emitters/componentResources.ts 8 ●●●● patch | view | raw | blame | history
quartz/components/renderPage.tsx
@@ -23,7 +23,7 @@
  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],
quartz/plugins/emitters/componentResources.ts
@@ -85,11 +85,11 @@
    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,
        });