mirror of
https://github.com/alexandrev/xslt-lab.git
synced 2026-09-22 05:33:16 +00:00
Add VITE_CLARITY_ID support to entrypoint.sh and Helm chart
This commit is contained in:
@@ -34,6 +34,10 @@ spec:
|
||||
- name: VITE_GA_ID
|
||||
value: {{ .Values.frontend.googleAnalyticsId | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.frontend.clarityId }}
|
||||
- name: VITE_CLARITY_ID
|
||||
value: {{ .Values.frontend.clarityId | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.adsTxt }}
|
||||
volumeMounts:
|
||||
- name: ads
|
||||
|
||||
@@ -64,6 +64,8 @@ frontend:
|
||||
backendUrl: ""
|
||||
# Optional Google Analytics measurement ID
|
||||
googleAnalyticsId: ""
|
||||
# Optional Microsoft Clarity project ID
|
||||
clarityId: ""
|
||||
|
||||
# Content for the optional ads.txt file served by the frontend
|
||||
adsTxt: ""
|
||||
|
||||
@@ -12,6 +12,7 @@ ADSENSE_CLIENT_ESC=$(escape_js_string "${VITE_ADSENSE_CLIENT}")
|
||||
ADSENSE_SLOT_ESC=$(escape_js_string "${VITE_ADSENSE_SLOT}")
|
||||
FIREBASE_CONFIG_ESC=$(escape_js_string "${VITE_FIREBASE_CONFIG}")
|
||||
GA_ID_ESC=$(escape_js_string "${VITE_GA_ID}")
|
||||
CLARITY_ID_ESC=$(escape_js_string "${VITE_CLARITY_ID}")
|
||||
|
||||
# Write runtime environment variables for the frontend
|
||||
cat <<EOF >/usr/share/nginx/html/env.js
|
||||
@@ -21,7 +22,8 @@ window.env = {
|
||||
VITE_ADSENSE_CLIENT: "${ADSENSE_CLIENT_ESC}",
|
||||
VITE_ADSENSE_SLOT: "${ADSENSE_SLOT_ESC}",
|
||||
VITE_FIREBASE_CONFIG: "${FIREBASE_CONFIG_ESC}",
|
||||
VITE_GA_ID: "${GA_ID_ESC}"
|
||||
VITE_GA_ID: "${GA_ID_ESC}",
|
||||
VITE_CLARITY_ID: "${CLARITY_ID_ESC}"
|
||||
};
|
||||
EOF
|
||||
|
||||
|
||||
Reference in New Issue
Block a user