mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-03 09:58:30 +02:00
* remove cookit (styling and logic), introduce segment load snippet directly into <head>, no consent for loading, add onetrust consent snippet and logic * simplify register call and leverage window.OnetrustActiveGroups * onetrust load before segment ready * add production value for HUGO_PARAMS_onetrustScriptId to netlify.toml
203 lines
10 KiB
HTML
203 lines
10 KiB
HTML
<!-- OneTrust Cookies Consent Notice start for local.qdrant.tech -->
|
|
{{ if .Site.Params.onetrustScriptID }}
|
|
{{ $testSuffix := "-test" }}
|
|
{{ if hugo.IsProduction }}
|
|
{{ $testSuffix = "" }}
|
|
{{ end }}
|
|
|
|
<script src="https://cdn.cookielaw.org/consent/{{ .Site.Params.onetrustScriptID }}{{ $testSuffix }}/otSDKStub.js" type="text/javascript" charset="UTF-8" data-domain-script="0196246a-3663-7350-9a45-b65f645d6314-test" ></script>
|
|
<script type="text/javascript">
|
|
function OptanonWrapper() {
|
|
const onetrustAnalyticsChoice = new CustomEvent('onetrust_loaded');
|
|
document.dispatchEvent(onetrustAnalyticsChoice);
|
|
}
|
|
</script>
|
|
{{ end }}
|
|
<!-- OneTrust Cookies Consent Notice end for local.qdrant.tech -->
|
|
|
|
<!-- Segment -->
|
|
{{ if hugo.IsProduction }}
|
|
<script>
|
|
!function(){const writeKey = "{{ .Site.Params.segmentWriteKey }}";var i="analytics",analytics=window[i]=window[i]||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","screen","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware","register"];analytics.factory=function(e){return function(){if(window[i].initialized)return window[i][e].apply(window[i],arguments);var n=Array.prototype.slice.call(arguments);if(["track","screen","alias","group","page","identify"].indexOf(e)>-1){var c=document.querySelector("link[rel='canonical']");n.push({__t:"bpc",c:c&&c.getAttribute("href")||void 0,p:location.pathname,u:location.href,s:location.search,t:document.title,r:document.referrer})}n.unshift(e);analytics.push(n);return analytics}};for(var n=0;n<analytics.methods.length;n++){var key=analytics.methods[n];analytics[key]=analytics.factory(key)}analytics.load=function(key,n){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.setAttribute("data-global-segment-analytics-key",i);t.src="https://evs.analytics.qdrant.tech/5caWuitPgcGFN5Q7HMpTaj/vEkmzjuRSqeXGbhGAFTWex.min.js";var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(t,r);analytics._loadOptions=n};analytics._writeKey=writeKey;analytics._cdn = "https://evs.analytics.qdrant.tech";analytics.SNIPPET_VERSION="5.2.0";
|
|
analytics.load(writeKey);
|
|
}}();
|
|
</script>
|
|
{{ else }}
|
|
<script>
|
|
!function(){const writeKey = "{{ .Site.Params.segmentWriteKey }}";var i="analytics",analytics=window[i]=window[i]||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","screen","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware","register"];analytics.factory=function(e){return function(){if(window[i].initialized)return window[i][e].apply(window[i],arguments);var n=Array.prototype.slice.call(arguments);if(["track","screen","alias","group","page","identify"].indexOf(e)>-1){var c=document.querySelector("link[rel='canonical']");n.push({__t:"bpc",c:c&&c.getAttribute("href")||void 0,p:location.pathname,u:location.href,s:location.search,t:document.title,r:document.referrer})}n.unshift(e);analytics.push(n);return analytics}};for(var n=0;n<analytics.methods.length;n++){var key=analytics.methods[n];analytics[key]=analytics.factory(key)}analytics.load=function(key,n){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.setAttribute("data-global-segment-analytics-key",i);t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js";var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(t,r);analytics._loadOptions=n};analytics._writeKey=writeKey;;analytics.SNIPPET_VERSION="5.2.0";
|
|
analytics.load(writeKey);
|
|
}}();
|
|
</script>
|
|
{{ end }}
|
|
|
|
<!--Google Measurement ID-->
|
|
{{ $googleJs := resources.Get "js/google-setup.js" | js.Build (dict "params" (dict "gaMeasurementId" .Site.Config.Services.GoogleAnalytics.ID)) | minify | resources.Fingerprint "sha512" }}
|
|
<script src="{{ $googleJs.RelPermalink }}"></script>
|
|
|
|
{{ $indexJs := resources.Get "/js/index.js" | js.Build | minify | resources.Fingerprint "sha512" }}
|
|
<script src="{{ $indexJs.RelPermalink }}"></script>
|
|
|
|
{{ if .IsHome }}
|
|
<!--splide.js carousel-->
|
|
{{ $splideJs := resources.Get "/js/vendor/splide.js" | js.Build | minify | resources.Fingerprint "sha512" }}
|
|
<script src="{{ $splideJs.RelPermalink }}"></script>
|
|
|
|
<!--Redirects for CMS authentication-->
|
|
<script>
|
|
// Check that current url contains `?token=...` parameter
|
|
// And if so, redirec to `/admin?token=...` page
|
|
|
|
// Get the current URL
|
|
const url = window.location.href;
|
|
|
|
// Use URLSearchParams to parse the query parameters
|
|
const params = new URLSearchParams(url.split('#')[1]);
|
|
|
|
// Check if the 'token' parameter is present
|
|
if (params.has('recovery_token')) {
|
|
// Get the value of the 'token' parameter
|
|
const token = params.get('recovery_token');
|
|
// Redirect to the '/admin' page with the same 'token' parameter
|
|
window.location.href = '/admin/#recovery_token=' + token;
|
|
}
|
|
|
|
// Check if the 'token' parameter is present
|
|
if (params.has('invite_token')) {
|
|
// Get the value of the 'token' parameter
|
|
const token = params.get('invite_token');
|
|
// Redirect to the '/admin' page with the same 'token' parameter
|
|
window.location.href = '/admin/#invite_token=' + token;
|
|
}
|
|
|
|
// Check if the 'token' parameter is present
|
|
if (params.has('confirmation_token')) {
|
|
// Get the value of the 'token' parameter
|
|
const token = params.get('confirmation_token');
|
|
// Redirect to the '/admin' page with the same 'token' parameter
|
|
window.location.href = '/admin/#confirmation_token=' + token;
|
|
}
|
|
</script>
|
|
{{ end }}
|
|
|
|
{{ if or (in (slice "docs" "documentation" "articles") .Section) (and (not .IsPage) (eq .Section "blog")) }}
|
|
{{ $pageSearchJs := resources.Get "/js/search/search.js" | js.Build | minify | resources.Fingerprint "sha512" }}
|
|
<script src="{{ $pageSearchJs.RelPermalink }}" type="module"></script>
|
|
{{ end }}
|
|
|
|
{{ if and .IsPage (in (slice "blog" "articles" "benchmarks" "docs" "documentation") .Section) }}
|
|
{{ $pageSearchScrollJs := resources.Get "/js/search/scroll.js" | js.Build | minify | resources.Fingerprint "sha512" }}
|
|
<script src="{{ $pageSearchScrollJs.RelPermalink }}"></script>
|
|
{{ end }}
|
|
|
|
{{ if in (slice "blog" "articles" "benchmarks" "docs" "documentation") .Section }}
|
|
<!--popper.js for bootstrap-->
|
|
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js"></script>
|
|
|
|
{{ $copyCodeJs := resources.Get "/js/copy-code.js" | js.Build | minify | resources.Fingerprint "sha512" }}
|
|
<script src="{{ $copyCodeJs.RelPermalink }}"></script>
|
|
|
|
{{ $langSwitcherJs := resources.Get "/js/lang-switcher.js" | js.Build | minify | resources.Fingerprint "sha512" }}
|
|
<script src="{{ $langSwitcherJs.RelPermalink }}"></script>
|
|
|
|
<!-- MathJax support -->
|
|
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
|
<script>
|
|
MathJax = {
|
|
tex: {
|
|
inlineMath: [
|
|
['$', '$'],
|
|
['\\(', '\\)'],
|
|
],
|
|
displayMath: [
|
|
['$$', '$$'],
|
|
['\\[', '\\]'],
|
|
],
|
|
processEscapes: true,
|
|
processEnvironments: true,
|
|
},
|
|
options: {
|
|
skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
|
|
},
|
|
};
|
|
|
|
window.addEventListener('load', (event) => {
|
|
document.querySelectorAll('mjx-container').forEach(function (x) {
|
|
x.parentElement.classList += 'has-jax';
|
|
});
|
|
});
|
|
</script>
|
|
|
|
{{ $anchorJs := resources.Get "/js/vendor/anchor.js" | js.Build | minify | resources.Fingerprint "sha512" }}
|
|
<script src="{{ $anchorJs.RelPermalink }}"></script>
|
|
{{ end }}
|
|
|
|
{{ if or (eq .Section "blog") (eq .Section "docs") (eq .Section "documentation") (eq .Section "articles") }}
|
|
<script>
|
|
document.addEventListener('keydown', function (event) {
|
|
if ((event.metaKey || event.ctrlKey) && event.key === 'k') {
|
|
event.preventDefault();
|
|
|
|
let searchButton = document.querySelector('[data-target="#searchModal"]');
|
|
|
|
if (searchButton) searchButton?.click();
|
|
}
|
|
});
|
|
</script>
|
|
{{ end }}
|
|
|
|
{{ if eq .Section "qdrant-for-startups" }}
|
|
<script>
|
|
const accordionButtons = Array.from(document.getElementsByClassName('accordion__item-header'));
|
|
|
|
accordionButtons.forEach((el) => {
|
|
el.addEventListener('click', function () {
|
|
this.parentElement.classList.toggle('active');
|
|
const panel = this.nextElementSibling;
|
|
if (panel.style.maxHeight) {
|
|
panel.style.maxHeight = null;
|
|
} else {
|
|
panel.style.maxHeight = panel.scrollHeight + 'px';
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
{{ end }}
|
|
|
|
{{ if and (eq .Section "blog") (.IsPage) }}
|
|
<script>
|
|
document.addEventListener("scroll", () => {
|
|
const article = document.getElementById("article");
|
|
const progress = document.getElementById("progress");
|
|
|
|
const articleHeight = article.scrollHeight - window.innerHeight;
|
|
const scrollTop = window.scrollY - article.offsetTop;
|
|
|
|
progress.value = Math.min(
|
|
Math.max((scrollTop / articleHeight) * 100, 0),
|
|
100
|
|
);
|
|
});
|
|
</script>
|
|
{{ end }}
|
|
|
|
<script>
|
|
window.addEventListener("message", event => {
|
|
if (
|
|
event.data.type === "hsFormCallback" &&
|
|
event.data.eventName === "onFormReady"
|
|
) {
|
|
const formEl = document.querySelector(`form[data-form-id="${event.data.id}"]`);
|
|
if (formEl) {
|
|
const hiddenCurrentUrl = formEl.querySelector('[name="last_form_fill_url"]');
|
|
if (hiddenCurrentUrl) {
|
|
hiddenCurrentUrl.value = window.location.href;
|
|
}
|
|
const hiddenReferrer = formEl.querySelector('[name="referrer_url"]');
|
|
if (hiddenReferrer) {
|
|
hiddenReferrer.value = document.referrer;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
</script>
|