Skip to content

Commit

Permalink
fix: Use .Site.Config.Services.GoogleAnalytics.ID instead. (#1348)
Browse files Browse the repository at this point in the history
* fix: Use .Site.Config.Services.GoogleAnalytics.ID instead.

Signed-off-by: Anush008 <[email protected]>

* chore: Updated config.toml

Signed-off-by: Anush008 <[email protected]>

---------

Signed-off-by: Anush008 <[email protected]>
  • Loading branch information
Anush008 authored Dec 13, 2024
1 parent 0369b3c commit c8c9b91
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
5 changes: 3 additions & 2 deletions qdrant-landing/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ languageCode = "en-us"
title = "Qdrant - Vector Database"
theme = "qdrant-2024"

googleAnalytics = "G-NZYW2651NE"
enableRobotsTXT = true
canonifyURLs = true

Expand Down Expand Up @@ -117,4 +116,6 @@ disableKinds = ["taxonomy", "term"]
environment = '{production}'
path = '{**.skip,**.skip/*}'


[services]
[services.googleAnalytics]
id = 'G-NZYW2651NE'
7 changes: 4 additions & 3 deletions qdrant-landing/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{ if hugo.IsProduction }}
{{ if .Site.GoogleAnalytics }}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ .Site.GoogleAnalytics }}"></script>
{{ if .Site.Config.Services.GoogleAnalytics.ID }}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ .Site.Config.Services.GoogleAnalytics.ID }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments)};
gtag('js', new Date());
gtag('config', '{{ .Site.GoogleAnalytics }}');
gtag('config', '{{ .Site.Config.Services.GoogleAnalytics.ID }}');
</script>
{{ end }}

Expand Down Expand Up @@ -38,6 +38,6 @@

<!--Segment-->
{{ if .Site.Params.segmentWriteKey }}
{{ $segmentJs := resources.Get "js/segment-setup.js" | js.Build (dict "params" (dict "segmentWriteKey" .Site.Params.segmentWriteKey "gaMeasurementId" .Site.GoogleAnalytics)) | minify | resources.Fingerprint "sha512" }}
{{ $segmentJs := resources.Get "js/segment-setup.js" | js.Build (dict "params" (dict "segmentWriteKey" .Site.Params.segmentWriteKey "gaMeasurementId" .Site.Config.Services.GoogleAnalytics.ID)) | minify | resources.Fingerprint "sha512" }}
<script src="{{ $segmentJs.RelPermalink }}?v=eu"></script>
{{ end }}
6 changes: 3 additions & 3 deletions qdrant-landing/themes/qdrant/layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@

{{ if hugo.IsProduction }}

{{ if .Site.GoogleAnalytics }}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ .Site.GoogleAnalytics }}"></script>
{{ if .Site.Config.Services.GoogleAnalytics.ID }}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ .Site.Config.Services.GoogleAnalytics.ID }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments)};
gtag('js', new Date());
gtag('config', '{{ .Site.GoogleAnalytics }}');
gtag('config', '{{ .Site.Config.Services.GoogleAnalytics.ID }}');
</script>
{{ end }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h5 class="tableOfContent__header">Table of contents</h5>
</ul>
<div class="divider pt-2 mb-3"></div>

{{ if (and (not .Params.hide_feedback) (.Site.Params.feedback.enable) (.Site.GoogleAnalytics)) }}
{{ if (and (not .Params.hide_feedback) (.Site.Params.feedback.enable) (.Site.Config.Services.GoogleAnalytics.ID)) }}
{{ partial "feedback.html" . -}}
{{ end }}
</div>
Expand Down

0 comments on commit c8c9b91

Please sign in to comment.