@xingwangzhe/stalux 1.22.1 → 1.22.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xingwangzhe/stalux",
3
- "version": "1.22.1",
3
+ "version": "1.22.3",
4
4
  "description": "A powerful, modern Astro blog theme — use as template or install as plugin",
5
5
  "keywords": [
6
6
  "astro",
@@ -6,20 +6,11 @@ const headConfig = getHeadData(configEntries);
6
6
  const id = headConfig?.bingClarityId;
7
7
  ---
8
8
 
9
- <script is:inline data-astro-rerun define:vars={{ id }}>
10
- // 防止重复初始化
11
- const load = () => {
12
- if (!id || document.getElementById("stalux-clarity-script") || window.clarity) return;
13
- (function (c, l, a, r, i, t, y) {
14
- c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments); };
15
- t = l.createElement(r);
16
- t.id = "stalux-clarity-script";
17
- t.async = 1;
18
- t.src = "https://www.clarity.ms/tag/" + i;
19
- y = l.getElementsByTagName(r)[0];
20
- y.parentNode.insertBefore(t, y);
21
- })(window, document, "clarity", "script", id);
22
- };
23
- if ("requestIdleCallback" in window) requestIdleCallback(load, { timeout: 4000 });
24
- else window.addEventListener("load", () => setTimeout(load, 0), { once: true });
25
- </script>
9
+ {
10
+ id && (
11
+ <>
12
+ <script type="text/partytown" set:html={`window.clarity = window.clarity || function(){ (window.clarity.q = window.clarity.q || []).push(arguments); };`}></script>
13
+ <script type="text/partytown" src={`https://www.clarity.ms/tag/${id}`}></script>
14
+ </>
15
+ )
16
+ }
@@ -6,11 +6,9 @@ const headConfig = getHeadData(configEntries);
6
6
  const gaID = headConfig?.googleAnalyticsId;
7
7
  const gaBootstrap = gaID
8
8
  ? `window.dataLayer = window.dataLayer || [];
9
- window.gtag = function gtag() {
10
- dataLayer.push(arguments);
11
- };
9
+ window.gtag = function gtag() { dataLayer.push(arguments); };
12
10
  gtag("js", new Date());
13
- gtag("config", ${JSON.stringify(gaID)});`
11
+ gtag("config", ${JSON.stringify(gaID)}, { allow_google_signals: false });`
14
12
  : "";
15
13
  ---
16
14