From 06e3f8b93d5fbe96e7a05e4eb6be97b6a2d7ead0 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sat, 17 Feb 2024 18:34:51 +0000
Subject: [PATCH] fix(style): introduce semiBoldWeight and various improvements to reduce CLS

---
 quartz/plugins/emitters/componentResources.ts |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/quartz/plugins/emitters/componentResources.ts b/quartz/plugins/emitters/componentResources.ts
index 290cb6f..0468416 100644
--- a/quartz/plugins/emitters/componentResources.ts
+++ b/quartz/plugins/emitters/componentResources.ts
@@ -120,7 +120,7 @@
   } else if (cfg.analytics?.provider === "umami") {
     componentResources.afterDOMLoaded.push(`
       const umamiScript = document.createElement("script")
-      umamiScript.src = ${cfg.analytics.host} ?? "https://analytics.umami.is/script.js"
+      umamiScript.src = "${cfg.analytics.host}" ?? "https://analytics.umami.is/script.js"
       umamiScript.setAttribute("data-website-id", "${cfg.analytics.websiteId}")
       umamiScript.async = true
 
@@ -196,10 +196,6 @@
       const cfg = ctx.cfg.configuration
       // component specific scripts and styles
       const componentResources = getComponentResources(ctx)
-      // important that this goes *after* component scripts
-      // as the "nav" event gets triggered here and we should make sure
-      // that everyone else had the chance to register a listener for it
-
       let googleFontsStyleSheet = ""
       if (fontOrigin === "local") {
         // let the user do it themselves in css
@@ -247,12 +243,15 @@
         }
       }
 
+      // important that this goes *after* component scripts
+      // as the "nav" event gets triggered here and we should make sure
+      // that everyone else had the chance to register a listener for it
       addGlobalPageResources(ctx, resources, componentResources)
 
       const stylesheet = joinStyles(
         ctx.cfg.configuration.theme,
-        ...componentResources.css,
         googleFontsStyleSheet,
+        ...componentResources.css,
         styles,
       )
       const [prescript, postscript] = await Promise.all([

--
Gitblit v1.10.0